Ruby on rails - bootstrap material 设计 - 将复选框添加到简单表单

Ruby on rails - bootstrap material design - Add checkboxes to simple form

我在 Rails 应用程序的 Ruby 中安装了 Bootstrap Material Design,每个动画都正常运行,但我看不到复选框。我的复选框代码是:

<div class='form-group'>
  <div class='control-label col-sm-2'>
  </div>
  <div class='col-sm-8'>
    <%= f.input :active, :as => :boolean, :label => false, :inline_label => true %>
  </div>
</div>

谁能帮帮我?

谢谢大家!

使用f.check_box代替f.input这个:

<div class='form-group'>
  <div class='control-label col-sm-2'>
  </div>
  <div class='col-sm-8'>
<%= f.check_box :active, :as => :boolean, :label => false, :inline_label => true %>
  </div>
</div>

我终于知道它在干什么了:

<div class='form-group'>
  <div class='control-label col-sm-2'>
</div>
  <div class="checkbox col-sm-8">
      <label> <%= f.check_box :active, :as => :boolean, :label => false, :inline_label => true %> Active</label>
  </div>
</div>

您需要在标签的div class中添加"checkbox",然后您将看到bootstrap material设计的复选框动画