aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-03-26 12:14:21 +0100
committerYves Senn <yves.senn@gmail.com>2013-03-26 12:14:21 +0100
commitd5f4cac68c069a3caff1712fd967ed70a4eb52da (patch)
tree2224af5040e70e66f7d6f04ef28bd2784a41b1fe /actionpack/lib
parent078bfbffa41e29a9d8ff2cf56e4c9254e7260f24 (diff)
downloadrails-d5f4cac68c069a3caff1712fd967ed70a4eb52da.tar.gz
rails-d5f4cac68c069a3caff1712fd967ed70a4eb52da.tar.bz2
rails-d5f4cac68c069a3caff1712fd967ed70a4eb52da.zip
bugfix, when matching multiple paths with `get`, `post`, ...
This problem was introduced with: https://github.com/rails/rails/commit/d03aa104e069be4e301efa8cefb90a2a785a7bff
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index c5f2b33602..f9893f2d85 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -589,8 +589,7 @@ module ActionDispatch
private
def map_method(method, args, &block)
options = args.extract_options!
- options[:via] = method
- options[:path] ||= args.first if args.first.is_a?(String)
+ options[:via] = method
match(*args, options, &block)
self
end
@@ -1381,7 +1380,11 @@ module ActionDispatch
raise ArgumentError, "Unknown scope #{on.inspect} given to :on"
end
- paths.each { |_path| decomposed_match(_path, options.dup) }
+ paths.each do |_path|
+ route_options = options.dup
+ route_options[:path] ||= _path if _path.is_a?(String)
+ decomposed_match(_path, route_options)
+ end
self
end