Displaying 1 result from an estimated 1 matches for "selection_id".
Did you mean:
reselection_id
2009 Jan 15
2
collection_select not selecting default value
Hi,
I''m trying to create a dropdown using collection_select. However, I cant
seem to get it to select the right option by default.
In my controller I have a setup like this:
@content = Content.new
@content.selection_id = 3
@selections = Selection.find(:all)
In my view I have:
<% form_for :content, @content, :url => { :action => ''create'' } do |f|
%>
<%= f.collection_select :selection, @selections, :id, :name %>
<%= submit_tag ''Create'' %>
<% e...