Cocoon, link_to_remove_association with confirmation?

is there an easy way to add a confirmation dialog that will appear when the user clicks on the link _ event_connection?

Cocoon gem is really wonderful, I wonder if it has such a ready-made option? if not, can i use jQuery to cancel or release the event?

Thank,

+3
source share
3 answers

You should be able to simply <%= link_to_remove_association 'Remove', f, data: { confirm: 'Are you sure that you want to remove these nested fields?' } %>, no?

+5
source
  = link_to_remove_association "remove item", f,  data: {confirm: 'Are you sure?'}

verified by:

+2
source

remove , false.

$(".container").on('click',"a.remove_fields",function(){
  return confirm("Do you want to delete this?") ;
});
+1

All Articles