I am looking for a replacement for the static scaffolding of Rails
1.2.x.
Rails 2.x has stopped proving the scaffolding.
Specifically I want to generate a controller from an existing model and
I want to have and freeze the code. Basically I just want to generate a
scaffold on which I am going to build my app (back and frontend). It is
also an example of code (I am still a newbie).
In 1.2.x the command was :
script/generate scaffold post blog/post
I quickly checked active_scaffold and streamlined. But I am not sure
they allow accessing the actual view code (rhtml/rjs/ruby), do they ?
Is static scaffolding completely deprecated, for everybody ?
You can type: ruby script/generate scaffold --help in your rails
application directory and you'll get the information on scaffolding.
Only dynamic
scaffolding is gone in 2.0 to my knowledge, not static.
Yes, you can. script/generate scaffold MyModel --skip-migration
Include --skip-migration to bypass the migration generation (you won't
need it since you've already got the model). This will give you the
scaffold but the views themselves may not auto-populate with the
fields.
You could also "script/generate controller MyModelsController index
show new create edit update delete" This definitely will not get the
auto-layout stuff, but it will stub things out for you. If you do
this you'll need to add your own map.resources statement to routes.rb.
Thx for the answer, I gonna check that. But the part I liked in the
controller generation was in fact the form generation. It helps a lot
the newbies (newbie even in html) like me. I am surprised it has been
deprecated.
I am still looking for it in AS or streamlined.