aboutsummaryrefslogtreecommitdiffstats
path: root/railties/generators/controller/USAGE
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 11:49:38 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 11:49:38 +0000
commit2594581e9f5594b32918326be895b4d443ab3e9c (patch)
tree051f52e4619b70f4757dbabf362d51a7d5f5fde9 /railties/generators/controller/USAGE
parent3ee4357b8643c611bbe9eb3a7ce820a5e32cddaa (diff)
downloadrails-2594581e9f5594b32918326be895b4d443ab3e9c.tar.gz
rails-2594581e9f5594b32918326be895b4d443ab3e9c.tar.bz2
rails-2594581e9f5594b32918326be895b4d443ab3e9c.zip
Added a better generator for scaffolding that actually creates the code, so it can be edited bit by bit. See "script/generate scaffold" [bitsweat]. Added a whole new approach to generators that used the shared "script/generate" command. Run with no-args to see help [bitsweat].
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@63 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/generators/controller/USAGE')
-rw-r--r--railties/generators/controller/USAGE29
1 files changed, 29 insertions, 0 deletions
diff --git a/railties/generators/controller/USAGE b/railties/generators/controller/USAGE
new file mode 100644
index 0000000000..0259b3d027
--- /dev/null
+++ b/railties/generators/controller/USAGE
@@ -0,0 +1,29 @@
+NAME
+ new_controller - create controller and view stub files
+
+SYNOPSIS
+ new_controller ControllerName action [action ...]
+
+DESCRIPTION
+ The new_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.
+
+EXAMPLE
+ new_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,
+ 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.