I run into a problem while trying to filter on a resource on Active Admin.
Filters actually work perfectly when I apply them to standard stuff but here it's a multi-select.
Indeed in my Deals model: There is a "Deal_goal" attribute and I can choose many Deal_goal such as "acquire new users", or "generate buzz"
Here is how I input it on my active admin form:
f.input :deal_goal,
:label => "Deal goals",
:as => :select,
:multiple => true,
:collection => DEAL_GOALS
To make the multi select, I serialize it on my Deal model
app/models/deal.rb
class Deal < ActiveRecord::Base
serialize :deal_goal, Array
I am also using staal.io advice for multi-selects (the 'chosen' gem)
What I fail to do is on my index page (list of deals), to have a filter on my Deal_goal attribute and if possible to have a multi-select here enabling me to filter on deals based on more than one type of goal (for example: filter deals with goal#1 or goal#3)
I tried both of what is below on admin/deal.rb and none worked!
filter :deal_goal, :as => :select, :collection => DEAL_GOALS
filter :deal_goal, :as => :multiple_select, :collection => DEAL_GOALS
Does anybody have a clue?