You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this time, sort_link is not looking at the search criteria in @search_form, but is looking at the params in 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, the sort_link will not reflect them.
A workaround is to set the search condition to params[:q] as follows.
Suppose you write
sort_link
as follows.At this time,
sort_link
is not looking at the search criteria in@search_form
, but is looking at theparams
in 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_link
will 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
params
if possible.Is there any other way?
The text was updated successfully, but these errors were encountered: