Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add further documentation + examples for the get, post, put and delet…

…e methods in ActionDispatch::Routing::Mapper::HttpHelpers
  • Loading branch information...
commit 203e45cd7fcbcb2ca548f778482c3ad0ad82d691 1 parent 3cf85fb
@radar radar authored
Showing with 21 additions and 1 deletion.
  1. +21 −1 actionpack/lib/action_dispatch/routing/mapper.rb
View
22 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -323,21 +323,41 @@ def define_generate_prefix(app, name)
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
Please sign in to comment.
Something went wrong with that request. Please try again.