I have a select list with three options. When I am adding a new
product I want the selected item to be “–select–” when I go to
update I want the selected item to come from the object data. My code
looks like this
<%=
select (
“product”,
:product_type_id,
ProductType.find(:all, :order => “label”).map {|type|
[type.label, type.id]},
:prompt => “-- Select --”
)
%>
Even when my object is @product.product_type_id = 0 I don’t ever see
the --select-- unless I set :selected => nil
What am I doing wrong?