I have a code that generates a form for me:
<%= form_for(@member) do |f| %>
<%= f.label :email %>
<%= f.text_field :email %>
<% end %>
I would like to customize the label for this field, ie. set a non-default one.
How would I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could be tempted to replace
f.label :emailwithf.label "whatever", but this’ll put you in troubles: you won’t be able to use your label for quick access to your text field by clicking on the label’s area. Make it this way:You text field and label will be associated, but the last one just will be having a different representation a page.