aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gunderloy <MikeG1@larkfarm.com>2009-03-27 05:20:39 -0500
committerMike Gunderloy <MikeG1@larkfarm.com>2009-03-27 05:21:33 -0500
commit9635741b8489e053d2753e57cc7f47cf7c520bba (patch)
treeeba36161eed770ce0b5093c79d9bf8be34cb1c11
parent0ddeb6e8d6b224a3fadc2b72f71401aa33b8bdf5 (diff)
downloadrails-9635741b8489e053d2753e57cc7f47cf7c520bba.tar.gz
rails-9635741b8489e053d2753e57cc7f47cf7c520bba.tar.bz2
rails-9635741b8489e053d2753e57cc7f47cf7c520bba.zip
Clear up a little confusing wording in Routing Guide.
-rw-r--r--railties/guides/source/routing.textile6
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index a4d9e140d5..e9adb4b308 100644
--- a/railties/guides/source/routing.textile
+++ b/railties/guides/source/routing.textile
@@ -582,7 +582,7 @@ To add a member route, use the +:member+ option:
map.resources :photos, :member => { :preview => :get }
</ruby>
-This will enable Rails to recognize URLs such as +/photos/1/preview+ using the GET HTTP verb, and route them to the preview action of the Photos controller. It will also create a +preview_photo+ route helper.
+This will enable Rails to recognize URLs such as +/photos/1/preview+ using the GET HTTP verb, and route them to the preview action of the Photos controller. It will also create the +preview_photo_url+ and +preview_photo_path+ route helpers.
Within the hash of member routes, each route name specifies the HTTP verb that it will recognize. You can use +:get+, +:put+, +:post+, +:delete+, or +:any+ here. You can also specify an array of methods, if you need more than one but you don't want to allow just anything:
@@ -598,7 +598,7 @@ To add a collection route, use the +:collection+ option:
map.resources :photos, :collection => { :search => :get }
</ruby>
-This will enable Rails to recognize URLs such as +/photos/search+ using the GET HTTP verb, and route them to the search action of the Photos controller. It will also create a +search_photos+ route helper.
+This will enable Rails to recognize URLs such as +/photos/search+ using the GET HTTP verb, and route them to the search action of the Photos controller. It will also create the +search_photos_url+ and +search_photos_path+ route helpers.
Just as with member routes, you can specify an array of methods for a collection route:
@@ -614,7 +614,7 @@ To add a new route (one that creates a new resource), use the +:new+ option:
map.resources :photos, :new => { :upload => :post }
</ruby>
-This will enable Rails to recognize URLs such as +/photos/upload+ using the POST HTTP verb, and route them to the upload action of the Photos controller. It will also create a +upload_photos+ route helper.
+This will enable Rails to recognize URLs such as +/photos/upload+ using the POST HTTP verb, and route them to the upload action of the Photos controller. It will also create the +upload_photos_path+ and +upload_photos_url+ route helpers.
TIP: If you want to redefine the verbs accepted by one of the standard actions, you can do so by explicitly mapping that action. For example:<br/>+map.resources :photos, :new => { :new => :any }+<br/>This will allow the new action to be invoked by any request to +photos/new+, no matter what HTTP verb you use.