From 20fa105c353331eebef0843afa3d71505f7475f5 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 29 May 2007 02:07:08 +0000 Subject: Wordsmith generator USAGEs. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6884 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../generators/components/controller/USAGE | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'railties/lib/rails_generator/generators/components/controller') diff --git a/railties/lib/rails_generator/generators/components/controller/USAGE b/railties/lib/rails_generator/generators/components/controller/USAGE index 246a3d652b..d4fae60c81 100644 --- a/railties/lib/rails_generator/generators/components/controller/USAGE +++ b/railties/lib/rails_generator/generators/components/controller/USAGE @@ -1,17 +1,16 @@ Description: - The controller generator creates stubs for a new controller and its views. + Stubs out a new controller and its views. Pass the controller name, either + CamelCased or under_scored, and a list of views as arguments. - The generator takes a controller name and a list of views as arguments. - The controller name may be given in CamelCase or under_score and should - not be suffixed with 'Controller'. To create a controller within a - module, specify the controller name as 'module/controller'. + To create a controller within a module, specify the controller name as a + path like 'parent_module/controller_name'. - The generator creates a controller class in app/controllers with view - templates in app/views/controller_name, a helper class in app/helpers, - and a functional test suite in test/functional. + This generates a controller class in app/controllers, view templates in + app/views/controller_name, a helper class in app/helpers, and a functional + test suite in test/functional. Example: - ./script/generate controller CreditCard open debit credit close + `./script/generate controller CreditCard open debit credit close` Credit card controller with URLs like /credit_card/debit. Controller: app/controllers/credit_card_controller.rb @@ -20,7 +19,7 @@ Example: Test: test/functional/credit_card_controller_test.rb Modules Example: - ./script/generate controller 'admin/credit_card' suspend late_fee + `./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 -- cgit v1.2.3