Fix error with link_to when options are nil
This commit is contained in:
parent
3ec36ce07b
commit
a33ef20726
|
@ -176,14 +176,13 @@ module Middleman
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Support a :query option that can be a string or hash
|
# Support a :query option that can be a string or hash
|
||||||
query = options.delete(:query)
|
if query = options.delete(:query)
|
||||||
if query
|
uri = URI(args[url_arg_index])
|
||||||
uri = URI(args[url_arg_index])
|
uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s
|
||||||
uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s
|
args[url_arg_index] = uri.to_s
|
||||||
args[url_arg_index] = uri.to_s
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
super(*args, &block)
|
super(*args, &block)
|
||||||
|
|
Loading…
Reference in a new issue