Skip to content

Commit

Permalink
Merge pull request #2665 from tvdeyen/resource-filter-fixes
Browse files Browse the repository at this point in the history
Resource filter fixes
  • Loading branch information
tvdeyen authored Dec 29, 2023
2 parents 14f67d8 + d006e02 commit 02f087c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/alchemy/admin/resources/_filter.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= select_tag(
filter.name,
options_for_select(
filter.options_for_select, params[:filter].try(:[], filter.name)
filter.options_for_select, search_filter_params.dig(:filter, filter.name)
),
include_blank: Alchemy.t(:all, scope: ['resources', resource_name, 'filters']),
data: { remote: !!request.xhr? },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= form_tag url_for, method: :get, class: 'per-page-select-form' do |f| %>
<% search_filter_params.reject { |k, _| k == 'page' || k == 'per_page' }.each do |key, value| %>
<% if value.is_a? Hash %>
<% if value.is_a? ActionController::Parameters %>
<% value.each do |k, v| %>
<%= hidden_field_tag "#{key}[#{k}]", v, id: nil %>
<% end %>
Expand Down

0 comments on commit 02f087c

Please sign in to comment.