In ruby, can i change the “text_field” to “list menu”? For example like
below…
*Gender
:
<%= text_field 'registration', 'gender'
%>
In ruby, can i change the “text_field” to “list menu”? For example like
below…
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. [email protected]
Thank you very much…it works.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs