如何将<div class =“fields”>中的simple_fields_for的HTML标记从div更改为其他内容?</div>

时间:2013-12-05 09:14:20

标签: twitter-bootstrap simple-form nested-forms

我正在使用simple_nested_form(simple_form,nested_form),twitter-bootstrap,我想使用<tr class="fields">来包装子记录的输入字段,在一个表行中包含一条记录,并且所有子项在表格中相互记录。我试过这个:

<%= f.simple_fields_for :classification_classes, wrapper_tag: 'tr', wrapper: :in_line do |ccf| %>

但不幸的是wrapper_tag: 'tr'没有改变任何东西。我正在使用自定义包装器in_line来使字段没有标签,并且使用span标记而不是div,但是对于破坏表格的HTML结构的最外层<div class="fields">没有控制权。 / p>

我知道https://github.com/ryanb/nested_form/wiki/How-To%3a-Render-nested-fields-inside-a-table,但是有一个没有simple_form的解决方案,在字段旁边缺少很好的验证错误呈现。

还有一个问题Nested table formatting with simple_form, nested_form and twitter-bootstrap,但它不像那里描述的那样有效。

有什么建议吗?

0 个答案:

没有答案