簡體   English   中英

具有Simple_form復選框的Bootstrap 3.2.0

[英]Bootstrap 3.2.0 with Simple_form checkbox

我有一個表格

 = simple_form_for([:admin, @user]) do |f|
  = f.input :email
  = f.association :roles, as: :select
  - if @user.has_role? :moderator
    = f.input :question, as: :boolean
    = f.input :answer, as: :boolean
    = f.input :comment, as: :boolean
  = f.submit 'Update'

使用bootstrap 3.1時,復選框可以正常工作,但是使用3.2時,則不會顯示,僅顯示標簽。 格式的HTML代碼:

<label class="checkbox"><input checked="checked" class="boolean optional" id="user_question" name="user[question]" type="checkbox" value="1"></label>

可以是什么?

只需添加.form-inline即可。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM