【发布时间】:2011-07-06 20:32:54
【问题描述】:
当我使用如下结构时:
<table>
<%= f.fields_for :group_locations do |gl| %>
<tr>
<td><%= gl.label :group_id %></td>
<td><%= gl.select :group_id, paths %></td>
</tr>
<% end %>
</table>
我在浏览器 (Safari) 中收到表中每一行的错误 (<input> is not allowed inside <tbody>. Inserting <input> before the <table> instead.) 这是由于将关联 ID 的隐藏 <input> 放置在 </tr> 之后造成的。如何使 id 的 <input> 出现在 TD 元素之一中?
【问题讨论】:
标签: ruby-on-rails forms views associations fields-for