Saturday, May 10, 2008

Rails 2.0: Why change the scaffolding

Rails 2.0.3 is now in market. There are many changes such as multi-views, using Model objects as resource handlers etc. However, the main change is how the scaffolding is done. Gone are the days of issuing Scaffold command and the table to be scaffolded. For example, if the name of table to be scaffold is Emp having Id and name . In the pre 2.0 era I would have given the following command

ruby script/generate scaffold Emp empAdmin

That would have generated the model named Emp with controller having the name empAdminController and the related views. Now how things have changed in 2.0

ruby script/generate scaffold Emp name:string

Yes, I had to pass the non id attributes to the scaffold command. Now if it is a trivial table with 3 or 4 columns then well and good. However, a table in real world will have atleast 15 columns then its just too much. I know scaffold is not seen as a good parctice in 2.0. However, scaffold was the reason I admired Rails. Now it seems like Rails is also making development a bit complex. Apart from that Rails 2.0 is really great.

1 comment:

Prashant Sree said...

hey,

Iam not much of a technical enthusiasts yet i suggest you to share these in technical forums, so that people can check on your ideas.,.
It might prove useful to newbies ;)

Continue on the good work !!