Forum: Ruby on Rails select_tag selected value?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Taylor S. (Guest)
on 2007-03-30 10:59
Administrative control panel which lists users and allows mass updates
of attributes from a single screen.

My code:
<%= select_tag("person[#{}][role]", '<option>user</option>
<option>admin</option>', options = {:selected => person.role}) %>

Rendered HTML:
<select id="person[5][role]" name="person[5][role]" selected="admin">

"admin" isn't selected when it should be!  all people have "user"
selected regardless of role defined in the DB.  Any ideas?
Jindong Y. (Guest)
on 2007-04-04 10:31
there's something you perhaps need!
This topic is locked and can not be replied to.