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
On a show page with a has_many association, you can filter the has_many records. For example if a company has_many customers and I'm on the company page with a has_many :customers field, I could filter the customers by name. Then, I might run an action on the filtered customers. When I finish running the action, the page reloads and the customers filters are reset.
I believe the filters get reset because Avo::ActionsController is redirecting to the request referrer.
The filter params would be in the has_many_field_show_customers turbo frame as the src, but the request referrer is /resources/company/42 which has no information about the turbo frame. If we could pass the turbo frame information to the action, could Avo::ActionsController#respond refresh the turbo frame instead of reloading the whole page? Then, the turbo frame would have its filters in place.
Or is there another way to keep the filter params around? In our app we do a lot of filtering and data updates, and losing the filters is a bummer.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
On a show page with a has_many association, you can filter the has_many records. For example if a company has_many customers and I'm on the company page with a
has_many :customers
field, I could filter the customers by name. Then, I might run an action on the filtered customers. When I finish running the action, the page reloads and the customers filters are reset.I believe the filters get reset because
Avo::ActionsController
is redirecting to the request referrer.avo/app/controllers/avo/actions_controller.rb
Lines 131 to 135 in c60e854
The filter params would be in the
has_many_field_show_customers
turbo frame as the src, but the request referrer is/resources/company/42
which has no information about the turbo frame. If we could pass the turbo frame information to the action, couldAvo::ActionsController#respond
refresh the turbo frame instead of reloading the whole page? Then, the turbo frame would have its filters in place.Or is there another way to keep the filter params around? In our app we do a lot of filtering and data updates, and losing the filters is a bummer.
Beta Was this translation helpful? Give feedback.
All reactions