Search code examples
ruby-on-railsrubysimple-form

SimpleForm label capitalizes my text. How to prevent?


I use simple_form gem and I have the following code:

= f.label f.object.name

Where f is a simple_form object created via simple_form_for(...) do |f|

But if name returns something like SOME WORD it generates capitalized text: Some word.

How to prevent it and generate text as is?


Solution

  • I found a similar ruby-forum topic. I tested it and it works in my simple_form

    Basically you should add a second parameter like this:

    = f.label :name, f.object.name
    = f.input :name