使用css,twitter-bootstrap和simple_form对各个布尔值的复选框进行分组

你能帮我格式化这个simple_form吗?

我使用这个表格:

 { :class => 'form-horizontal'} do |f| %>  
{:class => "span6", :rows => 2}%> {:class => "span6", :rows => 2}%> :hidden, :input_html => { :value => @my_model.id }%>
'btn-primary' %> t("helpers.links.cancel")), special_path, :class => 'btn' %>

我想将布尔值显示为两列复选框,每列垂直堆叠,每列有4个复选框。

就像是

 Some text: [input] A description: [input] bool1 bool5 bool2 bool6 bool3 bool7 bool4 bool8 

我在这里克隆了git存储库http://simple-form-b​​ootstrap.plataformatec.com.br/articles/new ,查看代码,运行它,我看到它有效。
但是……它适用于存储在字符串中的一系列复选框选项。 我有一个具有8个布尔值的模型,无法理解如何使用rails,css,twitter-bootstrap和simple_form在表单中正确分组它们。

我已阅读此SOpost: 将所有输入字段放在同一行
…而这一个: 在Rails中使用simple_form,nested_form和Twitter Bootstrap内联添加控件

……但它们似乎不适合我的特殊情况而且我没有想法尝试。

请尝试将您的答案集中在一个特定的代码示例上,该示例演示如何以某种分组方式布局各个布尔值的复选框。

提前致谢!

我过去只使用普通的网格控件制作了多列引导表单。 在你的情况下,像:

 
...
<%= f.input :boolean1 %> <%= f.input :boolean2 %> ...
<%= f.input :boolean5 %> <%= f.input :boolean6 %> ...
...

然后,您可以使用不同的spanoffset类调整所需的列。