aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-10-08 23:35:00 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-10-08 23:35:00 +0000
commit5728b82c01b05ab55292a463771dcafaba778f11 (patch)
treef574a450601339624f9c31e8338ba9ee2c7e0161 /railties/lib
parentc447d443dd1507c3485de30159adeaeacdc8254d (diff)
downloadrails-5728b82c01b05ab55292a463771dcafaba778f11.tar.gz
rails-5728b82c01b05ab55292a463771dcafaba778f11.tar.bz2
rails-5728b82c01b05ab55292a463771dcafaba778f11.zip
Added proper USAGE to the scaffold_resource generator [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5235 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails_generator/generators/components/scaffold_resource/USAGE14
1 files changed, 10 insertions, 4 deletions
diff --git a/railties/lib/rails_generator/generators/components/scaffold_resource/USAGE b/railties/lib/rails_generator/generators/components/scaffold_resource/USAGE
index c5046d7d63..86d6ec31a9 100644
--- a/railties/lib/rails_generator/generators/components/scaffold_resource/USAGE
+++ b/railties/lib/rails_generator/generators/components/scaffold_resource/USAGE
@@ -1,8 +1,9 @@
Description:
- The scaffold resource generator creates a model, a controller, and a set of templates for use in a REST-like,
- resource-oriented fashion. This basically means that it follows a set of conventions to exploit the full set of
- HTTP verbs (GET/POST/PUT/DELETE) and is prepared for multi-client access (like one view for HTML, one for an XML
- API, one for ATOM, etc). Everything comes with sample unit and functional tests as well.
+ The scaffold resource generator creates a model, a controller, and a set of templates that's ready to use as the
+ starting point for your REST-like, resource-oriented application. This basically means that it follows a set of
+ conventions to exploit the full set of HTTP verbs (GET/POST/PUT/DELETE) and is prepared for multi-client access
+ (like one view for HTML, one for an XML API, one for ATOM, etc). Everything comes with sample unit and functional
+ tests as well.
The generator takes the name of the model as its first argument. This model name is then pluralized to get the
controller name. So "scaffold_resource post" will generate a Post model and a PostsController and will be intended
@@ -16,6 +17,11 @@ Description:
You don't have to think up all attributes up front, but it's a good idea of adding just the baseline of what's
needed to start really working with the resource.
+
+ Once the generator has run, you'll need to add a declaration to your config/routes.rb file to hook up the rules
+ that'll point URLs to this new resource. If you create a resource like "scaffold_resource post", you'll need to
+ add "map.resources :posts" (notice the plural form) in the routes file. Then your new resource is accessible from
+ /posts.
Example:
./script/generate scaffold_resource post # no attributes, view will be anemic