Reputation: 88845
A client wants to be able to filter records based on a set of objects from a one-to-one relationship (rather than just one at a time) in ActiveAdmin. I'm having trouble finding documentation regarding such functionality.
How can I present a basic multi-select filter option instead of the single-select used by default in ActiveAdmin?
Upvotes: 2
Views: 3627
Reputation: 2947
It's very simple. Just add to your filter definition this option: multiple => true example:
filter(:categories, {
as: :select,
multiple: true,
input_html: {
class: :select2,
style: "width: 100%;"
},
label: I18n.t(:categories)
})
Upvotes: 5