问题
Im using cocoon to add "victimas" in my form. I would like to have a new button that allows to copy a "victima" added. I think, i should to call the method used to add association passing de fields form data filled. suggestions?.
View:
<%= link_to_add_association 'Añadir Víctima', f, :victima, {
partial: 'sivel2_gen/casos/victima_campos',
class: 'btn-primary',
"data-ajax" => File.join(
Rails.configuration.relative_url_root,
"victimas/nuevo"
),
"data-ajaxdata" => "caso_id" }
%>
来源:https://stackoverflow.com/questions/63198658/how-to-create-a-copy-of-item-added-in-cocoon-nsted-form-rails