Hi,
I have the following code:
<% @users.each do |u| -%>
<tr class="<%= cycle(“odd”, “even”) %>">
@member_statuses, :id, :name , { :class => “select”}, { :name =>
“member_status_id” } ) %>
<% end %>
The select is generating fine, apart from the fact that appropriate
options are not selected.
<%= u.member_status_id %> is returning correct values for the records
(1,2,3,4)
MemberStatus.all.inspect returns:
[#<MemberStatus id: 1, name_pl: “Obserwator”, name_en: “Observer”,
created_at: “2011-01-10 15:02:58”, updated_at: “2011-01-10 15:02:58”,
created_by: nil, updated_by: nil>, #<MemberStatus id: 2, name_pl:
“Baby”, name_en: “Baby Member”, created_at: “2011-01-10 15:02:58”,
updated_at: “2011-01-10 15:02:58”, created_by: nil, updated_by: nil>,
#<MemberStatus id: 3, name_pl: “Pełne”, name_en: “Full Member”,
created_at: “2011-01-10 15:02:58”, updated_at: “2011-01-10 15:02:58”,
created_by: nil, updated_by: nil>, #<MemberStatus id: 4, name_pl:
“Alumn”, name_en: “Alumni”, created_at: “2011-01-10 15:02:58”,
updated_at: “2011-01-10 15:02:58”, created_by: nil, updated_by: nil>,
#<MemberStatus id: 5, name_pl: “Zrezygnowa\305\202”, name_en:
“Resigned”, created_at: “2011-01-10 15:02:58”, updated_at: “2011-01-10
15:02:58”, created_by: nil, updated_by: nil>, #<MemberStatus id: 6,
name_pl: “Inactive”, name_en: “Inactive”, created_at: “2011-01-10
15:02:58”, updated_at: “2011-01-10 15:02:58”, created_by: nil,
updated_by: nil>]
But still, the helper is not putting the “selected” where it should.
Any advice?