I am working on a script that allows for an admin to assign multiple languages to a user.
I have my multi select working like so:
<%= fields_for :users_languages do |u| %>
<div class="field">
<%= @lang_list.inspect %>
<%= u.label :Assign_Languages %><br />
<%= select_tag :language_id, options_for_select(Language.all.collect {|lang| [lang.english, lang.id]}),:multiple => true, :prompt => 'Select Language' %>
</div>
<% end %>
But when I go in to edit the user their languages are not showing up as auto selected. How would I go about doing this?
I am a newb to ruby/rails, so sorry for the simple questions.
Thanks for all of the help in advance!