請使用html_options顯示使用Cocoon的'link_to_add_association'的任何示例。 https://github.com/nathanvda/cocoonRails 3.1。需要Cocoon link_to_add_association示例
文件說:
html_options: extra html-options (see link_to) There are two extra options that allow to conrol the placement of the new link-data:
data-association-insertion-node : the jquery selector of the node
data-association-insertion-position : insert the new data before or after the given node.
但我不明白的事,如果我想之前我的「添加元素」鏈接插入部分。不僅在父母的div開始之後。這不是要去工作:
<%= link_to_add_association 「添加元素」,F:production_years, :位置=> 「after_all」 %>
+1 - 這是非常需要的。謝謝! – Jordan
我認爲這是記錄良好的https://github.com/nathanvda/cocoon#control-the-insertion-behaviour(或至少比以前更好)。 – nathanvda
就這樣。不知何故,我錯過了。感謝您指出。 – Jordan