i am currently using this select = select(:schedule, :selected_players, @players.map { |p| [full_name(p), p.id] }, {:include_blank => 'None'}, "data-placeholder" => 'Add Players to Lineup', :prompt => 'Add Players to Lineup', :multiple => "multiple")
and would like to store the information into an array within the database, then access this array for different pars of the site
there is a copy of things im needing to know
- how best to store into the database, current this field value is binary
- how to then extract each value from the array
thanks
Sounds like you want
serialize.If you make the
selected_playerscolumn a text column and mark yourSchedulemodel withThen you can save a Ruby array into the attribute. It’ll be written to the database in YAML, and pop out exactly as it went in, as an array, when you read it.