I have the code
<%= form_for(@user) do |f| %>
<div>
<%= f.label :email, :class=>'inline betaLabelTextField' %>
<%= f.text_field :email, :class=>'betaTextField' %>
</div>
<% end %>
The problem is that this code automatically generates the html
<div>
<label class="inline betaLabelTextField" for="user_email">Email</label>
<input class="betaTextField" id="user_email" name="user[email]" size="30" type="text" />
</div>
Inside a form. How can i change 'Email' to 'Email Address'?
This is done by adding appropriate i18n values to config/locale/en.yml. Please have a look at the guides at http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models for the format of that file for active record values.
The easiest way is to do this instead:
<%= form_for(@user) do |f| %>
<div>
<%= f.label :email, "Email Address", :class=>'inline betaLabelTextField' %>
<%= f.text_field :email, :class=>'betaTextField' %>
</div>
<% end %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With