當我使用一個結構,如:fields_for表生產技術上不正確的HTML
<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.
)這是由隱藏<input>
引起該協會的身份證號碼位於</tr>
之後。我怎樣才能讓ID的<input>
出現在其中一個TD元素內?
我懷疑這會工作,但現在的問題有(神祕)消失。如果再出現,我會嘗試你的方法。 –