backend/app/helpers/spree/admin/base_helper.rb
# renders hidden field and link to remove record using nested_attributes
renders hidden field and link to remove record using nested_attributes
renders hidden field and link to remove record using nested_attributes
def link_to_remove_fields(name, form, options = {})
        name = '' if options[:no_text]
        options[:class] = '' unless options[:class]
        options[:class] += 'no-text with-tip' if options[:no_text]
        url = form.object.persisted? ? [:admin, form.object] : '#'
        link_to_with_icon('trash', name, url, class: "spree_remove_fields #{options[:class]}", data: { action: 'remove' }, title: t('spree.actions.remove')) +
          form.hidden_field(:_destroy)
      end
def link_to_remove_fields ( name , form , options = { } ) name = '' if options [ :no_text ] options [ :class ] = '' unless options [ :class ] options [ :class ] += 'no-text with-tip' if options [ :no_text ] url = form . object . persisted? ? [ :admin , form . object ] : '#' link_to_with_icon ( 'trash' , name , url , class : "spree_remove_fields #{options[:class]}" , data : { action : 'remove' } , title : t ( 'spree.actions.remove' ) ) + form . hidden_field ( :_destroy ) end
renders hidden field and link to remove record using nested_attributes
renders hidden field and link to remove record using nested_attributes
name
form
options