I am trying to generate a controller with all the RESTful actions stubbed. I had read at Wikibooks - Ruby on Rails that all I needed to do was to call the generator with the co
You're looking for scaffolding.
Try:
script/generate scaffold Property
This will give you a controller, a model, a migration and related tests. You can skip the migration with the option --skip-migration
. If you don't want the others, you'll have to delete them yourself. Don't worry about overwriting existing files, that won't happen unless you use --force
.
As klew points out in the comments, this also defines the method bodies for you, not just the names. It is very helpful to use as a starting point for your REST controller.