How to create a copy of item added in cocoon nsted form rails?

非 Y 不嫁゛ 提交于 2021-01-29 22:03:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!