提交 d1191507 编写于 作者: J Joshua Peek

Cleanup generate_extras build/parse mess

上级 1b82590c
......@@ -433,7 +433,7 @@ def generate(options, recall = {}, method = :generate)
raise ActionController::RoutingError, "No route matches #{options.inspect}"
end
uri, params = result
path, params = result
params.each do |k, v|
if v
params[k] = v
......@@ -442,16 +442,10 @@ def generate(options, recall = {}, method = :generate)
end
end
uri << "?#{params.to_query}" if uri && params.any?
path = uri
if path && method == :generate_extras
uri = URI(path)
extras = uri.query ?
Rack::Utils.parse_nested_query(uri.query).keys.map { |k| k.to_sym } :
[]
[uri.path, extras]
[path, params.keys]
elsif path
path << "?#{params.to_query}" if params.any?
path
else
raise ActionController::RoutingError, "No route matches #{options.inspect}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册