How do you generate views/controllers/tests for a brand new Rails 3.x application which has all the relevant model classes under app/models.
Asked
Active
Viewed 160 times
1
-
2http://stackoverflow.com/questions/4333393/using-rails-generate-scaffold-when-model-already-exists – c0deNinja Dec 08 '11 at 08:13
1 Answers
4
In the console type
rails generate controller <controller name> <action1> <action2> <etc..>
For instance
rails generate controller items new create edit update destroy index show
this generates items_controller.rb in app/controllers, new.html.erb, edit.html.erb and other actions in app/views and test templates in test/

Vikko
- 1,396
- 10
- 23