I'm trying to change the markup of an label_input.
This line (from simple_form_bootstrap.rb, wrapper inline_checkbox)
ba.use :label_input, :wrap_with => { :class => 'checkbox inline' }
and the call from my template:
= f.input :my_checkbox, as: :boolean, wrapper: :inline_checkbox, label: false, inline_label: "My label"
I get the following markup:
<div class="control-group boolean optional my_checkbox">
<div class="controls">
<div class="checkbox inline">
<input name="application[my_checkbox]" type="hidden" value="0">
<label class="checkbox">
<input class="boolean optional" id="my_checkbox" name="application[my_checkbox]" type="checkbox" value="1">
My label
</label>
</div>
</div>
</div>
Instead of having the checkbox input a child of the label, I want the checkbox input a sibling of the same div with the class "checkbox inline", like this:
<div class="control-group boolean optional my_checkbox">
<div class="controls">
<div class="checkbox inline">
<input name="application[my_checkbox]" type="hidden" value="0">
<input class="boolean optional" id="my_checkbox" name="application[my_checkbox]" type="checkbox" value="1">
<label class="checkbox">
My label
</label>
</div>
</div>
</div>
Using a custom wrapper, I am able to change the markup slightly, but :label_input always puts the input inside of the label. How can I change this behavior? Ideally, I have a new wrapper that doesn't use label_input, and instead uses a :label and an :input_field, but I've had no success.