Reputation: 6487
I'm using the following code to display a tree view selection box of categories:
grouped_collection_select(:categories, :category_id, Category.top_level, :children, :name, :id, :name, :include_blank => true)
How can I change it to allow multiple selection?
Also, is it possible to have it display checkboxes instead of a select box?
Upvotes: 7
Views: 2139
Reputation: 513
try
grouped_collection_select(:categories, :category_id, Category.top_level, :children, :name, :id, :name, {:include_blank => true}, { :multiple => true }
Upvotes: 5
Reputation: 11811
Maybe with
grouped_collection_select(:categories, :category_id, Category.top_level, :children, :name, :id, :name, :include_blank => true, { :multiple => true }
not tested!
Upvotes: 0