Using simple_form v2.1.0 in a Rails 3.2.13 app. I have a simple_form where I want to have a checkbox show up with an inline label, and I want to have an "empty" normal label. This way, the label's container should remain in place and the checkbox will be properly positioned with the other form elements.
If I set :label => ""
or :label => " "
or :label => nil
or don't provide a :label
at all, I end up with the field name as the label.
If I set :label => false
, the label and containing elements aren't rendered at all (so the checkbox appears at the far left of the page).
If I set :label => " "
, I end up with the literal text
, as expected.
It seems there is no way to tell simple form to leave the label there, just don't put any text in its container.
Here is an example form where I'm trying to setup an empty label for a checkbox with an inline label.
<%= simple_form_for @model ... %>
<%= f.input :sticky, :label => "", :inline_label => "Sticky?", :as => :boolean ... %>
<% end %>
But simple_form thinks it's smarter than me and defaults the label. I wish it only did that if I hadn't specifically supplied a label!