UPDATE
@selected
attributes:
group_id: "29"
attributes_cache: {}
@data
attributes:
created_at: 2010-06-19 10:16:13
term_id: "1"
updated_at: 2010-06-19 10:16:13
id: "29"
course_id: "1"
Hi,
I am trying to pre-select items within a select_tag
<%= select_tag "contact[group_ids][]",
options_for_select(
@data.map{ |d| [" Term #{d.term.number} #{d.term.start_date} #{d.course.course_type} #{d.course.course_name}"] },
@selected.map{ |j| j.id }
),
:multiple => true
%>
The @data object is all the items in the list and @selected contains the id's of the ones that should be selected.
Any ideas why they are not being selected ?
Thanks, Alex