[Question] The sort_link does not refer to the search criteria in the object passed in the first argument. #1627
lobin-z0x50
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose you write
sort_linkas follows.At this time,
sort_linkis not looking at the search criteria in@search_form, but is looking at theparamsin the controller to create the query string for the link.Therefore, even if the controller generates default search conditions, etc. and sets them in
@search_form, thesort_linkwill not reflect them.A workaround is to set the search condition to
params[:q]as follows.Is this the intended design?
We would like to avoid changing
paramsif possible.Is there any other way?
Beta Was this translation helpful? Give feedback.
All reactions