Rehan Khan said almost 7 years ago on Nested Forms with Cocoon :

<%= link_to_remove_association "remove task", f, class: 'btn btn-primary btn-xs' %>  not working