Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure options[:anchor] is correct in shorthand cases

  • Loading branch information...
commit 7c49b1adbbe1ffd42c8cd6fc0439d53895c861cf 1 parent 0c1ac36
@wycats wycats authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 actionpack/lib/action_dispatch/routing/mapper.rb
View
7 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -51,7 +51,9 @@ def extract_path_and_options(args)
options.merge!(:to => to).delete(path) if path
when using_match_shorthand?(args, options)
path = args.first
- options = { :to => path.gsub("/", "#"), :as => path.gsub("/", "_") }
+ options = { :to => path.gsub("/", "#"),
+ :as => path.gsub("/", "_")
+ }.merge(options || {})
else
path = args.first
end
@@ -301,7 +303,6 @@ def match(*args)
options = args.extract_options!
options = (@scope[:options] || {}).merge(options)
- options[:anchor] = true unless options.key?(:anchor)
if @scope[:name_prefix] && !options[:as].blank?
options[:as] = "#{@scope[:name_prefix]}_#{options[:as]}"
@@ -563,6 +564,8 @@ def mount(app, options = nil)
def match(*args)
options = args.extract_options!
+ options[:anchor] = true unless options.key?(:anchor)
+
if args.length > 1
args.each { |path| match(path, options) }
return self
Please sign in to comment.
Something went wrong with that request. Please try again.