REST
$ ruby script/generate scaffold_resource Model columnname:columntype
--skip-migration
The Payoff:
* You get a starter set of functional tests for your controller. Keep your
tests passing and you'll know your REST design is still intact.
* A controller named Products with all of the canonical CRUD actions defined
for you with boilerplate code. Comments with the routing paths (url pattern +
http verb) to invoke that action. An HTTP XML API defined.
* Boilerplate views for four of the CRUD actions (you'll just need to fill in
your model's details in the forms).
* A migration script. Define your table here, then run rake db:migrate.
* map.resources :models line at the top of routes.rb.
Version
1, updated 1048 days ago.
. o 0 (
edit |
history )