请使用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