0
Simpleform是否支持Bootstrap3單選按鈕?Simpleform Bootstrap 3單選按鈕
我試着用下面的配置自定義包裝,但這似乎不工作得很好。
config.wrappers :radio_buttons, tag: 'div', class: "form-group", error_class: "has-error" do |b|
b.use :html5
b.use :label, { class: "control-label col-lg-4" }
b.wrapper :tag => 'div', class: "col-lg-8" do |ba|
ba.wrapper :tag => 'div', class: 'checkbox' do |bb|
bb.use :input, { class: 'uniform', label: false }
bb.use :label_text { label: false }
end
end
b.use :hint, wrap_with: { tag: :p, class: "help-block" }
b.use :error, wrap_with: { tag: :span, class: "help-block text-danger" }
end
什麼能在此代碼來支持類似下面的變化?
<div class="col-lg-8">
<div class="checkbox">
<label>
<div class="radio"><span class="checked"><input class="uniform" type="radio" name="optionsRadios" value="option1" checked=""></span></div>Checked
radio
</label>
</div>
<!-- /.checkbox -->
<div class="checkbox">
<label>
<div class="radio"><span><input class="uniform" type="radio" name="optionsRadios" value="option2"></span></div>Unchecked
radio
</label>
</div>
<!-- /.checkbox -->
<div class="checkbox">
<label>
<div class="radio disabled"><span class="checked"><input class="uniform" type="radio" name="optionsRadios2" value="option3" checked="" disabled=""></span></div>
Disabled checked radio
</label>
</div>
<!-- /.checkbox -->
<div class="checkbox">
<label>
<div class="radio disabled"><span><input class="uniform" type="radio" name="optionsRadios2" value="option4" disabled=""></span></div>
Disabled unchecked radio
</label>
</div>
<!-- /.checkbox -->
</div>