Comments (6)
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.
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.
Can you paste the html code generate by simple form radio button ?
Thank you!
from enum_help.
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.
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.
@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)
- Capitalize the outputted choices? HOT 3
- I18n translation not working when using simple_form as: :string option
- Remove "enum_radio_buttons" classes?
- Translation for enums in model concerns
- "No" shown as "false" HOT 1
- alias_method_chain is deprecated in Rails 5 HOT 1
- i18n array with int keys HOT 1
- Adding gem to Rails 5 project changes belongs_to behavior HOT 3
- simple from item_wrapper_tag and item_wrapper_class not working
- display enum field value in view
- Select field not generated HOT 1
- Rails 5.1 `Gem Load Error is: uninitialized constant SimpleForm::Inputs::CollectionSelectInput` HOT 1
- The method .references() must contain arguments HOT 1
- Enum delegated attribute
- Support Rails 7 HOT 6
- could not use this gem without rails exists, Even though have active_record installed HOT 2
- input as radio buttons doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enum_help.