Skip to content

Commit

Permalink
Don't pass :class option and a query parameter in generated url
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Mar 21, 2022
1 parent f5160c1 commit 0e1d30e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ransack/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def name

def url_options
@params.merge(
@options.merge(
@options.except(:class).merge(
@search.context.search_key => search_and_sort_params))
end

Expand Down
2 changes: 2 additions & 0 deletions spec/ransack/helpers/form_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ module Helpers
)
}
it { should match /class="sort_link desc people"/ }
it { should_not match /people\?class=people/ }
end

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

describe '#search_form_for with default format' do
Expand Down

0 comments on commit 0e1d30e

Please sign in to comment.