Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the label builder not to force downcase everything?

when I'm using the label helper in a form contex, the label is getting downcased. Can I change this behavior?

example:

produce: "Things are getting big" but I want "Things Are Getting Big"

using rails 2.3

like image 684
johoder23 Avatar asked Aug 18 '10 17:08

johoder23


1 Answers

See documentation. First parameter for the label is the name of the field it references, not label's text. If there is no text provided, it uses field's name (localized/humanized)

Your label code produces

<label for="form_record_Things Are Getting Big">Things are getting big</label>

And you possibly need

<label for="form_record_field_name">Things are getting big</label>

You can do that with:

<%= f.label :field_name, "Things Are Getting Big" %>
like image 103
Voyta Avatar answered Sep 30 '22 20:09

Voyta