aboutsummaryrefslogtreecommitdiffstats
path: root/railties/generators/controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-09 15:54:22 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-09 15:54:22 +0000
commit3236e15cb7a00f00e119ff8dd9cde36cb6d3d180 (patch)
tree010f37ba1566cd53cda05aec60e8da1ae35026a0 /railties/generators/controller
parentc7589559dea75a735ccb74364b06d57f26f1db3d (diff)
downloadrails-3236e15cb7a00f00e119ff8dd9cde36cb6d3d180.tar.gz
rails-3236e15cb7a00f00e119ff8dd9cde36cb6d3d180.tar.bz2
rails-3236e15cb7a00f00e119ff8dd9cde36cb6d3d180.zip
Updated the usage documentation for the generator actions for their new home
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@101 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/generators/controller')
-rw-r--r--railties/generators/controller/USAGE25
1 files changed, 12 insertions, 13 deletions
diff --git a/railties/generators/controller/USAGE b/railties/generators/controller/USAGE
index 0259b3d027..e653d7e7ec 100644
--- a/railties/generators/controller/USAGE
+++ b/railties/generators/controller/USAGE
@@ -1,29 +1,28 @@
-NAME
- new_controller - create controller and view stub files
+GENERATOR
+ controller - create controller and view stub files
SYNOPSIS
- new_controller ControllerName action [action ...]
+ generate controller ControllerName action [action ...]
DESCRIPTION
- The new_controller generator takes the name of the new controller as the
+ The controller generator takes the name of the new controller as the
first argument and a variable number of view names as subsequent arguments.
The controller name should be supplied without a "Controller" suffix. The
generator will add that itself.
- From the passed arguments, new_controller generates a controller file in
- app/controllers with a render action for each of the view names passed.
- It then creates a controller test suite in test/functional with one failing
- test case. Finally, it creates an HTML stub for each of the view names in
- app/views under a directory with the same name as the controller.
+ Controller generates a controller file in app/controllers with a render
+ action for each of the view names passed, a test suite in test/functional
+ with one passing test case, and HTML stubs for each view in app/views
+ under a directory with the same name as the controller.
EXAMPLE
- new_controller Blog list display new edit
+ ./script/generate controller Blog list display new edit
This will generate a BlogController class in
app/controllers/blog_controller.rb, a BlogHelper class in
app/helpers/blog_helper.rb and a BlogControllerTest in
- test/functional/blog_controller_test.rb. It will also create list.rhtml,
+ test/functional/blog_controller_test.rb, and list.rhtml,
display.rhtml, new.rhtml, and edit.rhtml in app/views/blog.
- The BlogController class will have the following methods: list, display, new, edit.
- Each will default to render the associated template file.
+ The BlogController class will have list, display, new, and edit actions.
+ Each action will render the associated view by default.