mjbellantoni / formtastic-bootstrap

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

double label for :as => boolean #118

Closed optimum-dulopin closed 9 years ago

optimum-dulopin commented 9 years ago

when you use <%= f.input :my_field, :as => :boolean, :label => 'xxxxxxx' %>

it double the label before and after the checkbox

so it renders :

sodabrew commented 9 years ago

Is this with formtastic-bootstrap 3.1.0?

optimum-dulopin commented 9 years ago

yes

tijmenb commented 9 years ago

I'm running into this as well. Seems to be caused by https://github.com/mjbellantoni/formtastic-bootstrap/pull/94, specifically https://github.com/jtomaszewski/formtastic-bootstrap/commit/d212909bb101d78f134218d2274d3da45c02fc01#diff-1 @jtomaszewski can we keep checkbox_wrapping there and keep compatibility with horizontal forms at the same time?

This is the output of a f.input :accept_tos, as: :boolean, label: "I accept the ToS"

<div class="boolean input required checkbox" id="user_signup_accept_tos_input">
  <span class="form-label">
    <label for="user_signup_accept_tos" class=" control-label">
      <p>I accept the ToS</p>
    </label>
  </span>

  <span class="form-wrapper">
    <input type="hidden" name="user_signup[accept_tos]" value="0">
    <label for="user_signup_accept_tos" class=" control-label">
      <input type="checkbox" name="user_signup[accept_tos]" id="user_signup_accept_tos" value="1">
      <p>I accept the ToS</p>
    </label>
  </span>
</div>
optimum-dulopin commented 9 years ago

hi, is there anything we can do before this issue is corrected ?

jtomaszewski commented 9 years ago

Fixed in 16cb074ab56c2a71bc76956ff44f4d85c3063473 .

fredngo commented 9 years ago

Any chance for a 3.1.1 rubygem release?

tibbon commented 9 years ago

+1

bashantad commented 9 years ago

We are waiting for version 3.1.1 release.

jtomaszewski commented 9 years ago

@mjbellantoni , could you make the release?

sodabrew commented 9 years ago

Done! https://rubygems.org/gems/formtastic-bootstrap/versions/3.1.1

mjbellantoni commented 9 years ago

Thanks, Aaron!

-m

On Jul 19, 2015, at 1:07 PM, Aaron Stone notifications@github.com wrote:

Done! https://rubygems.org/gems/formtastic-bootstrap/versions/3.1.1

— Reply to this email directly or view it on GitHub.

ryanttb commented 9 years ago

Thank you! I just hit this and happy to see that it was resolved so quickly so all I had to do was update my gem.