diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-26 11:57:40 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-26 11:59:14 +0200 |
commit | e2346244a25ea9365ce0c93ca355c710b6712304 (patch) | |
tree | 053cf9f20741971ee71727626da9ff08feaf2d6d /railties/lib/generators/rails/controller/USAGE | |
parent | d40bd851190dd734a09965979c8ade285e51d52c (diff) | |
download | rails-e2346244a25ea9365ce0c93ca355c710b6712304.tar.gz rails-e2346244a25ea9365ce0c93ca355c710b6712304.tar.bz2 rails-e2346244a25ea9365ce0c93ca355c710b6712304.zip |
Added Controller Generators.
Diffstat (limited to 'railties/lib/generators/rails/controller/USAGE')
-rw-r--r-- | railties/lib/generators/rails/controller/USAGE | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/railties/lib/generators/rails/controller/USAGE b/railties/lib/generators/rails/controller/USAGE new file mode 100644 index 0000000000..42d38bd745 --- /dev/null +++ b/railties/lib/generators/rails/controller/USAGE @@ -0,0 +1,30 @@ +Description: + Stubs out a new controller and its views. Pass the controller name, either + CamelCased or under_scored, and a list of views as arguments. + + To create a controller within a module, specify the controller name as a + path like 'parent_module/controller_name'. + + This generates a controller class in app/controllers, view templates in + app/views/controller_name and then invokes the helper generator, the + current template engine and finally the test framework. + +Example: + `./script/generate controller CreditCard open debit credit close` + + Credit card controller with URLs like /credit_card/debit. + Controller: app/controllers/credit_card_controller.rb + Functional Test: test/functional/credit_card_controller_test.rb + Views: app/views/credit_card/debit.html.erb [...] + Helper: app/helpers/credit_card_helper.rb + Helper Test: test/unit/helpers/credit_card_helper_test.rb + +Modules Example: + `./script/generate controller 'admin/credit_card' suspend late_fee` + + Credit card admin controller with URLs /admin/credit_card/suspend. + Controller: app/controllers/admin/credit_card_controller.rb + Functional Test: test/functional/admin/credit_card_controller_test.rb + Views: app/views/admin/credit_card/debit.html.erb [...] + Helper: app/helpers/admin/credit_card_helper.rb + Helper Test: test/unit/helpers/admin/credit_card_helper_test.rb |