Permalink
Browse files

options could be of any kind of Hash (Hash, HashWithIndifferentAccess…

… or OrderedHash) this way we keep the properties of the options passed as an argument
  • Loading branch information...
spastorino authored and jeremy committed Jul 21, 2010
1 parent a78547a commit a1e795f554e07476f1084a0c76cb8b033d1d0b0c
@@ -454,7 +454,7 @@ def generate(options, recall = {}, extras = false)
def url_for(options)
finalize!
- options = default_url_options.merge(options || {})
+ options = (options || {}).reverse_merge!(default_url_options)
handle_positional_args(options)
@@ -129,7 +129,7 @@ def url_for(options = nil)
when String
options
when nil, Hash
- _routes.url_for(url_options.merge((options || {}).symbolize_keys))
+ _routes.url_for((options || {}).reverse_merge!(url_options).symbolize_keys)
else
polymorphic_url(options)
end
@@ -95,7 +95,7 @@ def url_for(options = {})
when String
options
when Hash
- options = { :only_path => options[:host].nil? }.update(options.symbolize_keys)
+ options = options.symbolize_keys.reverse_merge!(:only_path => options[:host].nil?)
super
when :back
controller.request.env["HTTP_REFERER"] || 'javascript:history.back()'

0 comments on commit a1e795f

Please sign in to comment.