mjbellantoni / formtastic-bootstrap

Formtastic form builder to generate Twitter Bootstrap-friendly markup.
MIT License
443 stars 218 forks source link

as: :boolean rendering wrong HTML #128

Open tibbon opened 9 years ago

tibbon commented 9 years ago

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 commented 9 years ago

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.

wintondeshong commented 9 years ago

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

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