With Rails 2.0, you cant do the following
- selectively scaffold a model /controller / migration.
- generate model and controller with different names via a single scaffold command.
Naturally, there was a big furor regarding scaffold philosophy change. Check out this scaffold discussion here.
The post Rails 2.0 era has scaffold working like this , basically all-in-one command, compact and rigid -
> ruby script\generate scaffold product
- The above command generates model, migration, controller, view and view helpers, all at one go. However, do remember to give the db columns of the product table in the scaffold command else the skelton gets generated for a non-attribute table/model which effectively doesnt serve any purpose. So here you go -
> ruby script\generate scaffold product name:string, category:string, price:float
No comments:
Post a Comment