Skip to content

Instantly share code, notes, and snippets.

@TomV
Created July 30, 2009 03:11
Show Gist options
  • Save TomV/158528 to your computer and use it in GitHub Desktop.
Save TomV/158528 to your computer and use it in GitHub Desktop.
<!-- This gets the error:
"undefined method `merge' for :code:Symbol"
-->
<%= f.collection_select(:section, :assessment_id, Assessment.all, :id, :code) %>
<!-- but building it manually works fine: -->
<select name="section[assessment_id]">
<% Assessment.all.each do |a| %>
<option value="<%= a.id %>"><%= a.code %></option>
<% end %>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment