https://github.com/rails/rails/pull/8233
在 url 里面加入 params 参数,只要不是 Hash
就会报错!
Rails2 和 Rails3 都会报错!
比如 http://ruby-china.org/topics?params=
https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/http/url.rb#L25
def url_for(options = {})
path = ""
path << options.delete(:script_name).to_s.chomp("/")
path << options.delete(:path).to_s
params = options[:params] || {}
params.reject! {|k,v| v.to_param.nil? }
result = build_host_url(options)
result << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path)
result << "?#{params.to_query}" unless params.empty?
result << "##{Journey::Router::Utils.escape_fragment(options[:anchor].to_param.to_s)}" if options[:anchor]
result
end