formtastic-bootstrap icon indicating copy to clipboard operation
formtastic-bootstrap copied to clipboard

as: :boolean rendering wrong HTML

Open tibbon opened this issue 9 years ago • 2 comments

Inside a form:

= f.input :failed, as: :boolean

yields:

<div class="boolean input optional form-group checkbox" id="failed_input">
  <span class="form-wrapper">
    <input type="hidden" name="something[failed]" value="0">
    <label for="transfer_failed" class=" control-label">
    <input type="checkbox" name="something[failed]" id="something_failed" value="1">Failure Text</label>
</span>
</div>

Whereas I'm expecting something more like: https://github.com/twbs/bootlint/wiki/E017 which would be more like:

    .checkbox
      %label
        %input{type: 'checkbox'} Truth

tibbon avatar Jul 08 '15 18:07 tibbon

This is making it so that Bootstrap 3.x doesn't match the selector properly, and just throws the checkbox and text mashed on top of each other.

tibbon avatar Jul 08 '15 18:07 tibbon

+1 Setting the label property to 'false' for the time being...

= f.input :remember_me, as: :boolean, label: false

wintondeshong avatar Jul 18 '15 23:07 wintondeshong