Select multiple options in a collection_select rails

ruby, ruby-on-rails-3

Solution

Ok after some trial and error

<%= f.collection_select(:sector_id, Sector.all, :id, :name, {:prompt => "Please Select a Sector"}, {:multiple => true}) %>

lets me select multiple options

Problem

I know how to put together a simple select box that takes its values from a model ``` <%= f.collection_select(:sector_id, Sector.all, :id, :name, :prompt => "Please Select a Sector") %> ``` My question is how do i allow a user to select multiple options and then store them in the model. I know i need to use ``` :multiple => true ``` But unsure on the syntax Usually for multiple entries to a model i would use accepts_nested_attributes_for but am i correct in thinking i don't need to for this example? Thanks

Original source