[Rails] Can't get select helper to populate dropdown w/default value

Peter Jagielski pjagielski at gmail.com
Sun Jan 1 17:00:06 GMT 2006


Guys,

I searched this forum and found plenty of people having this problem, 
but I didn't see any definitive solution.  Usings Rails 1.0.

When I edit an existing record, I can't get the basic "select" helper to 
display the current value contained in the field of the record.  All of 
my other (text) fields populate correctly with current field values.

There appears to be a ":selected =>" option with the select helper and 
some of its variations, but I can't get it to work.  Frankly, I thought 
it would simply "work", in the same way that text fields get populated 
correctly.

Am I doing something wrong, is the select helper broken, or is it simply 
not supposed to display the current value when editing?

-- 
Posted via http://www.ruby-forum.com/.


More information about the Rails mailing list