aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/request.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-02-22 09:00:53 -0800
committerXavier Noria <fxn@hashref.com>2012-02-22 09:00:53 -0800
commit7f2548e34d79c47ca138ca0378f4a06390c407f1 (patch)
tree4807b806fe8f3cfe30314fc522599b776e4a6d36 /actionpack/lib/action_dispatch/http/request.rb
parentf28d9f15482addeb95ab05545b7a8467a4e0182d (diff)
parent002713c64568114f3754799acc0723ea0d442f7a (diff)
downloadrails-7f2548e34d79c47ca138ca0378f4a06390c407f1.tar.gz
rails-7f2548e34d79c47ca138ca0378f4a06390c407f1.tar.bz2
rails-7f2548e34d79c47ca138ca0378f4a06390c407f1.zip
Merge pull request #5130 from dlee/revised_patch_verb
Add config.default_method_for_update to support PATCH
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/request.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 0a0ebe7fad..de014a9c00 100644
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -97,6 +97,12 @@ module ActionDispatch
HTTP_METHOD_LOOKUP[request_method] == :post
end
+ # Is this a PATCH request?
+ # Equivalent to <tt>request.request_method == :patch</tt>.
+ def patch?
+ HTTP_METHOD_LOOKUP[request_method] == :patch
+ end
+
# Is this a PUT request?
# Equivalent to <tt>request.request_method_symbol == :put</tt>.
def put?