Refactor the link_to_add_fields helper. Remove the onclick option from link_to and add specific classes to hook the onclick event via JS code.