2
我正在使用cocoon添加嵌套的屬性。我在我的觀點如下代碼:無法在表中添加字段與繭
<table>
<thead>
<tr>
<th>Title</th>
<th>Action</th>
</tr>
</thead>
<tbody id="emergency_personnels">
<%= f.fields_for :emergency_personnels do |emergency_personnel| %>
<%= render 'emergency_personnel_fields', f: emergency_personnel %>
<% end %>
</tbody>
</table>
<%= link_to_add_association 'Add emergency personnel', f, :emergency_personnels, data: {"association-insertion-node" => "tbody#emergency_personnels", "association-insertion-method" => "append"} %>
它應該工作正常,但新的字段不表,而不是出現在表外的TBODY下追加。
任何人都可以提出一個解決方案。由於
它與一些調整工作。謝謝 –
請分享調整....我會更新我的答案 –