mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Cleanup generate_extras build/parse mess
This commit is contained in:
parent
1b82590c36
commit
d1191507bc
1 changed files with 3 additions and 9 deletions
|
@ -433,7 +433,7 @@ module ActionDispatch
|
|||
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 @@ module ActionDispatch
|
|||
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}"
|
||||
|
|
Loading…
Reference in a new issue