From f8ffc5d0bb2050f1ec95914e1589edf815caa28b Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Wed, 18 Sep 2024 22:19:01 +0930 Subject: [PATCH] Retain persistent params when searching and filtering --- app/views/trestle/search/_search.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/trestle/search/_search.html.erb b/app/views/trestle/search/_search.html.erb index 4d9b00b..de49bc9 100644 --- a/app/views/trestle/search/_search.html.erb +++ b/app/views/trestle/search/_search.html.erb @@ -2,12 +2,14 @@ <% if admin.searchable? %> @@ -16,9 +18,7 @@ <% if admin.filterable? %>
<%= form_for admin.filters, as: :f, url: admin.path, method: :get, builder: Trestle::Form::Builder, html: { id: nil, class: nil, data: { turbo_frame: "main" } } do |f| %> - <% persistent_params.each do |k, v| %> - <%= hidden_field_tag k, v unless k == "f" %> - <% end %> + <%= serialize_persistent_params except: :f %>