提交 0adb8f8f 编写于 作者: A Aaron Patterson

Parameters are converted to a query string

Since parameters are converted to a query string, they will
automatically be turned in to strings by the query parser
上级 11bc0789
......@@ -414,19 +414,6 @@ def xml_http_request(*args)
end
alias xhr :xml_http_request
def paramify_values(hash_or_array_or_value)
case hash_or_array_or_value
when Hash
Hash[hash_or_array_or_value.map{|key, value| [key, paramify_values(value)] }]
when Array
hash_or_array_or_value.map {|i| paramify_values(i)}
when Rack::Test::UploadedFile, ActionDispatch::Http::UploadedFile
hash_or_array_or_value
else
hash_or_array_or_value.to_param
end
end
# Simulate a HTTP request to +action+ by specifying request method,
# parameters and set/volley the response.
#
......@@ -486,10 +473,6 @@ def process(action, *args)
parameters ||= {}
# Ensure that numbers and symbols passed as params are converted to
# proper params, as is the case when engaging rack.
parameters = paramify_values(parameters) if html_format?(parameters)
if format.present?
parameters[:format] = format
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册