what the difference between static scaffolding and Dynamic
scaffolding?

Answer Posted / vinit baheti

With Rails 2.0, you may have noticed that dynamic
scaffolding breaks–that is, if you have a controller with
scaffold :model_name in it, all the scaffolded actions–new,
delete, index–no longer exist! In Rails 2.0, you can only
generate static scaffolding–that is, you can use the
scaffold to generate the files for controllers, models, and
views.

What’s more, Rails 2.0 allows you to specify the model
attributes inside the scaffold. This then creates views with
all the appropriate fields, and it also creates the
migration with all the fields in it! Excellent!

As an example, say we wanted to create a blog-post model. We
could generate it like so:

script/generate scaffold Post title:string content:text
category_id:integer

You’ll notice Rails will generate, among other things:

* A post.rb model file
* A posts_controller.rb controller file
* A posts view folder containing views for the index,
show, new, and edit actions
* A DB migration called xxx_create_posts
* A unit-test, fixtures file, and helper

Everything you need–indeed, everything the dynamic
scaffolding provided–is included, albeit as static content.
All you need to do is migrate your DB and you’re up and flying!

So the main difference is, with dynamic scaffolding you can
generate new, edit and delete methods but with static
scaffolding you can't

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is rails active record?

471


what is the difference between redirect and render in Ruby on Rails?

551


What are the three methods to install ruby on rails?

478


What is the role of mvc architecture in ruby on rails?

476


how you can run Rails application without creating databases?

455






Explain the importance of yield statement in rails.

491


Explain how you can run rails application without creating databases?

447


how can we define Ruby regular expressions?

488


how you define Instance Variable, Global Variable and Class Variable in Ruby?

493


What is the difference between symbol and string?

510


Difference between argument and parameter in ruby on rails ?

465


who developed rails?

536


what is Cross-Site Request Forgery (CSRF) and how Rails is protected against it?

496


What is difference between form_for and form_tag?

487


Can you explain me how rails implements ajax?

448