Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-select and multiple inputs for a single scope don't work together #225

Open
neilvcarvalho opened this issue Sep 1, 2023 · 1 comment

Comments

@neilvcarvalho
Copy link

Hi, folks,

I have a scope involving multiple fields, and some of those fields are multi-select fields.

I noticed that Filterrific drops some of the params for this multi-input scope. After investigating, I found out that the dropped params are the array-type params.

For example:

<%= fields_for :with_skills do |skills_form| %>
  <%= f.select :skills, skill_options, multiple: true %>
  <%= f.select :expertise, expertise_options %>
<% end %>

In this case, params will receive something like: {filters: { with_skills: {skills: ["knitting", "kungfu"], expertise: "mentor"}}}

Filterrific will accept the expertise filter, but not the skills filter.

I noticed https://github.com/jhund/filterrific/blob/master/lib/filterrific/param_set.rb#L27 handles multi-input scopes and multi-select fields, but not both. I plan to open a PR fixing this.

@neilvcarvalho
Copy link
Author

This issue is fixed by #213

@jhund I'd be so thankful if #213 is merged and you cut a new release with this fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant