Forum: Ruby on Rails List Menu

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.
Hasana H. (Guest)
on 2007-03-19 11:46
In ruby, can i change the "text_field" to "list menu"? For example like

<tr><td><div align="right"><label
for="registration_gender"><strong><font color="red">*</font>Gender
<td><div align="left"><%= text_field 'registration', 'gender'
Marc L. (Guest)
on 2007-03-19 12:09
(Received via mailing list)
Sure.  For this simple example you would use the select method.
Instead of <%= text_field 'registration', 'gender' %>, you'd use:

<%= select 'registration', 'gender', {"Male" => "Male", "Female" =>
"Female"}, { :include_blank => true } %>

Check the <a href="
Helpers/FormOptionsHelper.html#M000506">documentation</a> for more


On Mar 19, 2:46 am, Hasana H. <removed_email_address@domain.invalid>
Hasana H. (Guest)
on 2007-03-19 17:47
Thank you very works.
This topic is locked and can not be replied to.