Fix #158 feature request (remove empty search params from sort_link params hash and URL)
Builds on the discussion in PR #207. Submitted as a pull request to see if there is interest in having a shorter sort_link URL. If yes, will need some test coverage.
This commit is contained in:
parent
be7c227a95
commit
b1644d4d24
|
@ -18,6 +18,8 @@ module Ransack
|
|||
@context = Context.for(object, options)
|
||||
@context.auth_object = options[:auth_object]
|
||||
@base = Nodes::Grouping.new(@context, 'and')
|
||||
params = (params.delete_if { |k, v| v.blank? && v != false }
|
||||
) if params.present?
|
||||
build(params.with_indifferent_access)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue