File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ * Fix ` :data ` option to ` sort_link ` being incorrectly appended to the generated
6+ link query parameters.
7+ PR [ 1301] ( https://github.com/activerecord-hackery/ransack/pull/1301 )
8+
59## 3.0.0 - 2022-03-30
610
711* Move documentation into Docusaurus.
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def name
130130
131131 def url_options
132132 @params . merge (
133- @options . except ( :class ) . merge (
133+ @options . except ( :class , :data ) . merge (
134134 @search . context . search_key => search_and_sort_params ) )
135135 end
136136
Original file line number Diff line number Diff line change @@ -758,6 +758,18 @@ module Helpers
758758 end
759759 end
760760
761+ describe '#sort_link with data option' do
762+ subject { @controller . view_context
763+ . sort_link (
764+ [ :main_app , Person . ransack ( sorts : [ 'name desc' ] ) ] ,
765+ :name ,
766+ data : { turbo_action : :advance } , controller : 'people'
767+ )
768+ }
769+ it { should match /data-turbo-action="advance"/ }
770+ it { should_not match /people\? data%5Bturbo_action%5D=advance/ }
771+ end
772+
761773 describe '#search_form_for with default format' do
762774 subject { @controller . view_context
763775 . search_form_for ( Person . ransack ) { } }
You can’t perform that action at this time.
0 commit comments