Giter Site home page Giter Site logo

Comments (6)

zmbacker avatar zmbacker commented on June 30, 2024

Please tell me what's the version of your bootstrap. I have test radio button with bootstrap 3 and there is no problem.

from enum_help.

akikumon avatar akikumon commented on June 30, 2024

Sorry for my late reply.

I use ver.3.3.1 bundling via rails-assets.
also simple_form ver.3.1.0.rc2 using.

I encountered on Chrome 38.0.2125.111 and Mac-Yosemite. Is depends on my environment?

from enum_help.

zmbacker avatar zmbacker commented on June 30, 2024

Can you paste the html code generate by simple form radio button ?

Thank you!

from enum_help.

KevinBongart avatar KevinBongart commented on June 30, 2024

Just had the same issue. Using enum_help 0.0.12, simple_form 3.1.0 and bootstrap-sass 3.3.1.0:

class Integration < ActiveRecord::Base
  enum threshold: [:all_alerts, :critical_alerts, :disabled]
end
<%= f.input :threshold, as: :radio_buttons %>

gives me:

<div class="form-group enum_radio_buttons optional integration_threshold">
  <label class="enum_radio_buttons optional control-label">Threshold</label>
  <span class="radio radio radio">
    <label for="integration_threshold_all_alerts">
      <input class="enum_radio_buttons optional form-control" type="radio" value="all_alerts" checked="checked" name="integration[threshold]" id="integration_threshold_all_alerts">
      all_alerts
    </label>
  </span>
  <span class="radio radio radio">
    <label for="integration_threshold_critical_alerts">
      <input class="enum_radio_buttons optional form-control" type="radio" value="critical_alerts" name="integration[threshold]" id="integration_threshold_critical_alerts">
      critical_alerts
    </label>
  </span>
  <span class="radio radio radio">
    <label for="integration_threshold_disabled">
      <input class="enum_radio_buttons optional form-control" type="radio" value="disabled" name="integration[threshold]" id="integration_threshold_disabled">
      disabled
    </label>
  </span>
</div>

@akikumon's right. The issue is caused by the .control-label class on the input elements, and using f.input :threshold, as: :radio_buttons, wrapper: :vertical_radio_and_checkboxes fixes it.

<div class="form-group enum_radio_buttons optional integration_threshold">
  <label class="enum_radio_buttons optional control-label">Threshold</label>
  <span class="radio radio radio">
    <label for="integration_threshold_all_alerts">
      <input class="enum_radio_buttons optional" type="radio" value="all_alerts" checked="checked" name="integration[threshold]" id="integration_threshold_all_alerts">
      all_alerts
    </label>
  </span>
  <span class="radio radio radio">
    <label for="integration_threshold_critical_alerts">
      <input class="enum_radio_buttons optional" type="radio" value="critical_alerts" name="integration[threshold]" id="integration_threshold_critical_alerts">
      critical_alerts
    </label>
  </span>
  <span class="radio radio radio">
    <label for="integration_threshold_disabled">
      <input class="enum_radio_buttons optional" type="radio" value="disabled" name="integration[threshold]" id="integration_threshold_disabled">
      disabled
    </label>
  </span>
</div>

from enum_help.

pwim avatar pwim commented on June 30, 2024

As mentioned above, this issue is a simple_form one, not an enum_help one. See heartcombo/simple_form#886 for details. I'd recommend closing the issue.

from enum_help.

akikumon avatar akikumon commented on June 30, 2024

@pwim
Sorry for my too lazy reply.

Ok, I'll try your recommendation.
Now I close this issue.

Thank you.

from enum_help.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.