diff options
author | Travis Pew <travis@travispew.com> | 2011-11-28 15:46:09 -0500 |
---|---|---|
committer | Travis Pew <travis@travispew.com> | 2011-11-28 15:46:09 -0500 |
commit | 237272e049e409c9f620dfadb7cf0688e8c91b0f (patch) | |
tree | 896e871f69cf0e434e855c60e5a49eec2f360641 | |
parent | afa31cf327893d79826e0a7d5a8667a44213c161 (diff) | |
download | rails-237272e049e409c9f620dfadb7cf0688e8c91b0f.tar.gz rails-237272e049e409c9f620dfadb7cf0688e8c91b0f.tar.bz2 rails-237272e049e409c9f620dfadb7cf0688e8c91b0f.zip |
Fix ActionDispatch::Request method explanations
The methods, "post?", "put?", "head?", etc. contain an incorrect
explanation. They state that they are equivalent to request_method ==
:type, but this is not accurate because the methods convert the string
to a symbol. They are actually equivalent to:
request_method_symbol == :type
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 69ca050d0c..e86dfd64d2 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -94,31 +94,31 @@ module ActionDispatch end # Is this a GET (or HEAD) request? - # Equivalent to <tt>request.request_method == :get</tt>. + # Equivalent to <tt>request.request_method_symbol == :get</tt>. def get? HTTP_METHOD_LOOKUP[request_method] == :get end # Is this a POST request? - # Equivalent to <tt>request.request_method == :post</tt>. + # Equivalent to <tt>request.request_method_symbol == :post</tt>. def post? HTTP_METHOD_LOOKUP[request_method] == :post end # Is this a PUT request? - # Equivalent to <tt>request.request_method == :put</tt>. + # Equivalent to <tt>request.request_method_symbol == :put</tt>. def put? HTTP_METHOD_LOOKUP[request_method] == :put end # Is this a DELETE request? - # Equivalent to <tt>request.request_method == :delete</tt>. + # Equivalent to <tt>request.request_method_symbol == :delete</tt>. def delete? HTTP_METHOD_LOOKUP[request_method] == :delete end # Is this a HEAD request? - # Equivalent to <tt>request.method == :head</tt>. + # Equivalent to <tt>request.method_symbol == :head</tt>. def head? HTTP_METHOD_LOOKUP[method] == :head end |