How to hide shortcut in Rails (Haml) form?

I have a little form:

= f.label :option_1, "title" = f.check_box :option_1 

And this is a render:

imgimg How to remove " Option 1 " from the tag?

+5
source share
4 answers

= f.check_box :option_1, label: "title" works for me :)

0
source

Do not call the label helper method at all!

Instead

 = f.label :option_1, "title" = f.check_box :option_1 

Use only

 = f.check_box :option_1 
0
source

Do you just need a "title" and a checkbox under it? This should work:

  = f.label "title" = f.check_box :option_1 
0
source

= f.label :option_1, "title" = f.check_box :option_1, label: false

0
source

All Articles