collection_select not selecting value when it exists
I have a collection of ParsingTeams. Each ParsingTeam has an associated
Team. I'm trying to create dropdown boxes for each ParsingTeam and where
the associated Team already exists, I want that team to be selected. I can
generate the dropdown but no values ever get selected. Here's my code:
<ul class="recent-posts">
<% @parsingteams.each do |team| %>
<li>
<span class="user-info"><h5><%= team.teamname %></h5></span>
<%= collection_select(team, "team_id", @teams, :id, :teamname) %>
</li>
<% end %>
</ul>
I've tried several variations of the object and method for the
collection_select with no luck.
No comments:
Post a Comment