aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-05-04 11:39:20 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-05-04 11:39:20 -0700
commit9ce057d8ccc799eb4844494e3c6ee553969a66d3 (patch)
treed8c3856173917e656ffc5915a819dacbf06d3c1c /actionpack/lib/action_dispatch
parent3f46e7aae9f56a8fa1f4dd800d8947d780cd5534 (diff)
parentd03aa104e069be4e301efa8cefb90a2a785a7bff (diff)
downloadrails-9ce057d8ccc799eb4844494e3c6ee553969a66d3.tar.gz
rails-9ce057d8ccc799eb4844494e3c6ee553969a66d3.tar.bz2
rails-9ce057d8ccc799eb4844494e3c6ee553969a66d3.zip
Merge pull request #6160 from carlosantoniodasilva/resource-route-canonical-action
Force given path to http methods in mapper to skip canonical action checking
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 4ea3937057..2a7d540517 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -535,7 +535,8 @@ module ActionDispatch
private
def map_method(method, args, &block)
options = args.extract_options!
- options[:via] = method
+ options[:via] = method
+ options[:path] ||= args.first if args.first.is_a?(String)
match(*args, options, &block)
self
end
@@ -1509,7 +1510,7 @@ module ActionDispatch
prefix = shallow_scoping? ?
"#{@scope[:shallow_path]}/#{parent_resource.path}/:id" : @scope[:path]
- path = if canonical_action?(action, path.blank?)
+ if canonical_action?(action, path.blank?)
prefix.to_s
else
"#{prefix}/#{action_path(action, path)}"