diff options
author | Chris Kampmeier <chris@kampers.net> | 2008-12-26 16:32:14 -0500 |
---|---|---|
committer | Chris Kampmeier <chris@kampers.net> | 2008-12-26 16:32:14 -0500 |
commit | d49fa21a0318c75a30b52e7d68ee3338f1fdf429 (patch) | |
tree | 4a165e64c8842f8a3472069f4becf0288443ae94 /actionpack/lib | |
parent | fe9239e9c647e63b64037342dd1b714777e3b3ae (diff) | |
download | rails-d49fa21a0318c75a30b52e7d68ee3338f1fdf429.tar.gz rails-d49fa21a0318c75a30b52e7d68ee3338f1fdf429.tar.bz2 rails-d49fa21a0318c75a30b52e7d68ee3338f1fdf429.zip |
ActionController::Request docs: fix reference to nonexistent ACCEPTED_HTTP_METHODS constant, clean up #request_method and #method
Diffstat (limited to 'actionpack/lib')
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 8a02130d88..732172668e 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -41,17 +41,19 @@ module ActionController HTTP_METHODS = %w(get head put post delete options) HTTP_METHOD_LOOKUP = HTTP_METHODS.inject({}) { |h, m| h[m] = h[m.upcase] = m.to_sym; h } - # The true HTTP request \method as a lowercase symbol, such as <tt>:get</tt>. - # UnknownHttpMethod is raised for invalid methods not listed in ACCEPTED_HTTP_METHODS. + # Returns the true HTTP request \method as a lowercase symbol, such as + # <tt>:get</tt>. If the request \method is not listed in the HTTP_METHODS + # constant above, an UnknownHttpMethod exception is raised. def request_method method = @env['REQUEST_METHOD'] HTTP_METHOD_LOOKUP[method] || raise(UnknownHttpMethod, "#{method}, accepted HTTP methods are #{HTTP_METHODS.to_sentence}") end memoize :request_method - # The HTTP request \method as a lowercase symbol, such as <tt>:get</tt>. - # Note, HEAD is returned as <tt>:get</tt> since the two are functionally - # equivalent from the application's perspective. + # Returns the HTTP request \method used for action processing as a + # lowercase symbol, such as <tt>:post</tt>. (Unlike #request_method, this + # method returns <tt>:get</tt> for a HEAD request because the two are + # functionally equivalent from the application's perspective.) def method request_method == :head ? :get : request_method end |