mirror of
https://github.com/activerecord-hackery/ransack.git
synced 2022-11-09 13:47:45 -05:00
Exclude "host" from params sent to url generator (#1317)
This commit is contained in:
parent
db4ed2cc0f
commit
0c5078c462
2 changed files with 13 additions and 1 deletions
|
@ -130,7 +130,7 @@ module Ransack
|
|||
|
||||
def url_options
|
||||
@params.merge(
|
||||
@options.except(:class, :data).merge(
|
||||
@options.except(:class, :data, :host).merge(
|
||||
@search.context.search_key => search_and_sort_params))
|
||||
end
|
||||
|
||||
|
|
|
@ -770,6 +770,18 @@ module Ransack
|
|||
it { should_not match /people\?data%5Bturbo_action%5D=advance/ }
|
||||
end
|
||||
|
||||
describe "#sort_link with host option" do
|
||||
subject { @controller.view_context
|
||||
.sort_link(
|
||||
[:main_app, Person.ransack(sorts: ['name desc'])],
|
||||
:name,
|
||||
host: 'foo', controller: 'people'
|
||||
)
|
||||
}
|
||||
it { should match /href="\/people\?q/ }
|
||||
it { should_not match /href=".*foo/ }
|
||||
end
|
||||
|
||||
describe '#search_form_for with default format' do
|
||||
subject { @controller.view_context
|
||||
.search_form_for(Person.ransack) {} }
|
||||
|
|
Loading…
Reference in a new issue