1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Santiago Pastorino 2010-07-21 20:59:05 -03:00 committed by Jeremy Kemper
parent a78547a9c6
commit a1e795f554
3 changed files with 3 additions and 3 deletions

View file

@ -454,7 +454,7 @@ module ActionDispatch
def url_for(options) def url_for(options)
finalize! finalize!
options = default_url_options.merge(options || {}) options = (options || {}).reverse_merge!(default_url_options)
handle_positional_args(options) handle_positional_args(options)

View file

@ -129,7 +129,7 @@ module ActionDispatch
when String when String
options options
when nil, Hash when nil, Hash
_routes.url_for(url_options.merge((options || {}).symbolize_keys)) _routes.url_for((options || {}).reverse_merge!(url_options).symbolize_keys)
else else
polymorphic_url(options) polymorphic_url(options)
end end

View file

@ -95,7 +95,7 @@ module ActionView
when String when String
options options
when Hash when Hash
options = { :only_path => options[:host].nil? }.update(options.symbolize_keys) options = options.symbolize_keys.reverse_merge!(:only_path => options[:host].nil?)
super super
when :back when :back
controller.request.env["HTTP_REFERER"] || 'javascript:history.back()' controller.request.env["HTTP_REFERER"] || 'javascript:history.back()'