5
votes

I'm looking to make a filter on my admin page for a user to show users who have both Subject_A and Subject_B.

Using the following line of code I've been able to filter for the users who have either Subject_A or Subject_B or both.

filter :universities, as: :select, multiple: true

Is there a way to create a filter using Active Admin to filter for users that only have both Subject_A and Subject_B?

2

2 Answers

9
votes

multiple: true never worked for me. The following did however:

filter :section, label: 'Category', 
  as: :select, input_html: { multiple: true }, 
  collection: User.categories
0
votes

You can try this:

filter :universities_and_universities, as: :select, multiple: true

This is not the perfect solution but it should works fine