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:
parent
a78547a9c6
commit
a1e795f554
3 changed files with 3 additions and 3 deletions
|
@ -454,7 +454,7 @@ module ActionDispatch
|
|||
|
||||
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 @@ module ActionDispatch
|
|||
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 @@ module ActionView
|
|||
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()'
|
||||
|
|
Loading…
Reference in a new issue