aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-11-07 10:26:18 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-11-07 11:39:27 +1000
commit203e45cd7fcbcb2ca548f778482c3ad0ad82d691 (patch)
tree11fbeb43f2b69e8efc79b06e4bf669dadd00e88b /actionpack/lib
parent3cf85fb4fcdae65a4d5a1a5c418492ea0cf9ad6d (diff)
downloadrails-203e45cd7fcbcb2ca548f778482c3ad0ad82d691.tar.gz
rails-203e45cd7fcbcb2ca548f778482c3ad0ad82d691.tar.bz2
rails-203e45cd7fcbcb2ca548f778482c3ad0ad82d691.zip
Add further documentation + examples for the get, post, put and delete methods in ActionDispatch::Routing::Mapper::HttpHelpers
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 3c7dcea003..c58562db24 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -323,21 +323,41 @@ module ActionDispatch
module HttpHelpers
# Define a route that only recognizes HTTP GET.
+ # For supported arguments, see +match+.
+ #
+ # Example:
+ #
+ # get 'bacon', :to => 'food#bacon'
def get(*args, &block)
map_method(:get, *args, &block)
end
# Define a route that only recognizes HTTP POST.
+ # For supported arguments, see +match+.
+ #
+ # Example:
+ #
+ # post 'bacon', :to => 'food#bacon'
def post(*args, &block)
map_method(:post, *args, &block)
end
# Define a route that only recognizes HTTP PUT.
+ # For supported arguments, see +match+.
+ #
+ # Example:
+ #
+ # put 'bacon', :to => 'food#bacon'
def put(*args, &block)
map_method(:put, *args, &block)
end
- # Define a route that only recognizes HTTP DELETE.
+ # Define a route that only recognizes HTTP PUT.
+ # For supported arguments, see +match+.
+ #
+ # Example:
+ #
+ # delete 'broccoli', :to => 'food#broccoli'
def delete(*args, &block)
map_method(:delete, *args, &block)
end