Froze rails gems
[depot.git] / vendor / rails / railties / lib / rails_generator / generators / components / controller / USAGE
1 Description:
2 Stubs out a new controller and its views. Pass the controller name, either
3 CamelCased or under_scored, and a list of views as arguments.
4
5 To create a controller within a module, specify the controller name as a
6 path like 'parent_module/controller_name'.
7
8 This generates a controller class in app/controllers, view templates in
9 app/views/controller_name, a helper class in app/helpers, and a functional
10 test suite in test/functional.
11
12 Example:
13 `./script/generate controller CreditCard open debit credit close`
14
15 Credit card controller with URLs like /credit_card/debit.
16 Controller: app/controllers/credit_card_controller.rb
17 Views: app/views/credit_card/debit.html.erb [...]
18 Helper: app/helpers/credit_card_helper.rb
19 Test: test/functional/credit_card_controller_test.rb
20
21 Modules Example:
22 `./script/generate controller 'admin/credit_card' suspend late_fee`
23
24 Credit card admin controller with URLs /admin/credit_card/suspend.
25 Controller: app/controllers/admin/credit_card_controller.rb
26 Views: app/views/admin/credit_card/debit.html.erb [...]
27 Helper: app/helpers/admin/credit_card_helper.rb
28 Test: test/functional/admin/credit_card_controller_test.rb
29