From 237272e049e409c9f620dfadb7cf0688e8c91b0f Mon Sep 17 00:00:00 2001 From: Travis Pew Date: Mon, 28 Nov 2011 15:46:09 -0500 Subject: 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 --- actionpack/lib/action_dispatch/http/request.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_dispatch') 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 request.request_method == :get. + # Equivalent to request.request_method_symbol == :get. def get? HTTP_METHOD_LOOKUP[request_method] == :get end # Is this a POST request? - # Equivalent to request.request_method == :post. + # Equivalent to request.request_method_symbol == :post. def post? HTTP_METHOD_LOOKUP[request_method] == :post end # Is this a PUT request? - # Equivalent to request.request_method == :put. + # Equivalent to request.request_method_symbol == :put. def put? HTTP_METHOD_LOOKUP[request_method] == :put end # Is this a DELETE request? - # Equivalent to request.request_method == :delete. + # Equivalent to request.request_method_symbol == :delete. def delete? HTTP_METHOD_LOOKUP[request_method] == :delete end # Is this a HEAD request? - # Equivalent to request.method == :head. + # Equivalent to request.method_symbol == :head. def head? HTTP_METHOD_LOOKUP[method] == :head end -- cgit v1.2.3 From e3bc1385f1e8d2816deb215880d99aca136c0cc3 Mon Sep 17 00:00:00 2001 From: Aviv Ben-Yosef Date: Wed, 30 Nov 2011 06:55:34 +0200 Subject: Fixing incorrect documentation `path_names` can only be used for affecting `new` and `edit` --- actionpack/lib/action_dispatch/routing/mapper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 7947e9d393..88e422c05d 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1046,8 +1046,8 @@ module ActionDispatch # Takes same options as Base#match as well as: # # [:path_names] - # Allows you to change the paths of the seven default actions. - # Paths not specified are not changed. + # Allows you to change the segment component of the +edit+ and +new+ actions. + # Actions not specified are not changed. # # resources :posts, :path_names => { :new => "brand_new" } # -- cgit v1.2.3