8000 Merge pull request #3881 from activeadmin/3874-except_hidden_fields · stephancom/activeadmin@48a8674 · GitHub
[go: up one dir, main page]

Skip to content

Commit 48a8674

Browse files
committed
Merge pull request activeadmin#3881 from activeadmin/3874-except_hidden_fields
add Filters::ViewHelper#except_hidden_fields
2 parents 88c8234 + 74163a8 commit 48a8674

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/active_admin/filters/forms.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,18 @@ def active_admin_filters_form_for(search, filters, options = {})
6565
buttons = content_tag :div, class: "buttons" do
6666
f.submit(I18n.t('active_admin.filters.buttons.filter')) +
6767
link_to(I18n.t('active_admin.filters.buttons.clear'), '#', class: 'clear_filters_btn') +
68-
hidden_field_tags_for(params, except: [:q, :page])
68+
hidden_field_tags_for(params, except: except_hidden_fields)
6969
end
7070

7171
f.template.concat buttons
7272
end
7373
end
7474

75+
private
76+
77+
def except_hidden_fields
78+
[:q, :page]
79+
end
7580
end
7681

7782
end

0 commit comments

Comments
 (0)
0