ruby on rails - How to control :selected for collection_select? -


currently if call @team.user_ids returns "1,3,7" opposed [1,3,7]. need other reasons, it's breaking front-end collection_select. i've tested , works fine array, step left manually choose items selected considering can't rails default way.

= f.collection_select :user_ids, @company.users, :id, :username,   { :include_blank => true }, { :multiple => true, :class => "chzn-select" }  

how go doing this? thanks!

i solved adding :selected => @team.users.map(&:id)


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -