List Menu


#1

In ruby, can i change the “text_field” to “list menu”? For example like
below…

*Gender :
<%= text_field 'registration', 'gender' %>

#2

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 documentation for more
details.

Marc

On Mar 19, 2:46 am, Hasana H. removed_email_address@domain.invalid


#3

Thank you very much…it works.