Don't pass `:class` option and a query parameter in generated url

This commit is contained in:
David Rodríguez 2022-03-21 13:58:18 +01:00
parent f5160c1b4b
commit 0e1d30ec80
No known key found for this signature in database
GPG Key ID: 1008A258BB37309C
2 changed files with 3 additions and 1 deletions

View File

@ -130,7 +130,7 @@ module Ransack
def url_options
@params.merge(
@options.merge(
@options.except(:class).merge(
@search.context.search_key => search_and_sort_params))
end

View File

@ -735,6 +735,7 @@ module Ransack
)
}
it { should match /class="sort_link desc people"/ }
it { should_not match /people\?class=people/ }
end
describe '#sort_link with class option workaround' do
@ -748,6 +749,7 @@ module Ransack
)
}
it { should match /class="sort_link desc people"/ }
it { should_not match /people\?class=people/ }
end
describe '#search_form_for with default format' do