mirror of
https://github.com/github/rails.git
synced 2026-01-30 16:58:15 -05:00
Add documentation for route conditions. Closes #9041 [innu, manfred]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8094 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Add documentation for route conditions. Closes #9041 [innu, manfred]
|
||||
|
||||
* Fix typo left over from previous typo fix in url helper. Closes #9414 [Henrik N]
|
||||
|
||||
* Fixed that ActionController::CgiRequest#host_with_port() should handle standard port #10082 [moro]
|
||||
|
||||
@@ -204,6 +204,24 @@ module ActionController
|
||||
# must appear at the end of the path. The globbed values are in <tt>params[:path]</tt> in
|
||||
# this case.
|
||||
#
|
||||
# == Route conditions
|
||||
#
|
||||
# With conditions you can define restrictions on routes. Currently the only valid condition is <tt>:method</tt>.
|
||||
#
|
||||
# * <tt>:method</tt> - Allows you to specify which method can access the route. Possible values are <tt>:post</tt>,
|
||||
# <tt>:get</tt>, <tt>:put</tt>, <tt>:delete</tt> and <tt>:any</tt>. The default value is <tt>:any</tt>,
|
||||
# <tt>:any</tt> means that any method can access the route.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# map.connect 'post/:id', :controller => 'posts', :action => 'show',
|
||||
# :conditions => { :method => :get }
|
||||
# map.connect 'post/:id', :controller => 'posts', :action => 'create_comment',
|
||||
# :conditions => { :method => :post }
|
||||
#
|
||||
# Now, if you POST to <tt>/posts/:id</tt>, it will route to the <tt>create_comment</tt> action. A GET on the same
|
||||
# URL will route to the <tt>show</tt> action.
|
||||
#
|
||||
# == Reloading routes
|
||||
#
|
||||
# You can reload routes if you feel you must:
|
||||
|
||||
Reference in New Issue
Block a user