1

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.

priya
  • 24,861
  • 26
  • 62
  • 81

1 Answers1

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