Situation:
Administrative control panel which lists users and allows mass updates
of attributes from a single screen.
My code:
<%= select_tag("person[#{person.id}][role]",
''<option>user</option>
<option>admin</option>'', options = {:selected =>
person.role}) %>
Rendered HTML:
<select id="person[5][role]" name="person[5][role]"
selected="admin">
<option>user</option>
<option>admin</option>
</select>
Problem:
"admin" isn''t selected when it should be! all people have
"user"
selected regardless of role defined in the DB. Any ideas?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---