lib/ransack/helpers/form_helper.rb in ransack-3.2.1 vs lib/ransack/helpers/form_helper.rb in ransack-4.0.0
- old
+ new
@@ -127,11 +127,11 @@
.join(' '.freeze)
.html_safe
end
def url_options
- @params.merge(
+ @params.except(:host).merge(
@options.except(:class, :data, :host).merge(
@search.context.search_key => search_and_sort_params))
end
def html_options(args)
@@ -178,10 +178,11 @@
def search_and_sort_params
search_params.merge(s: sort_params)
end
def search_params
- @params[@search.context.search_key].presence || {}
+ query_params = @params[@search.context.search_key]
+ query_params.is_a?(Hash) ? query_params : {}
end
def sort_params
sort_array = recursive_sort_params_build(@sort_fields)
return sort_array[0] if sort_array.length == 1