Method: EffectiveCartsHelper#link_to_empty_cart

Defined in:
app/helpers/effective_carts_helper.rb


75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'app/helpers/effective_carts_helper.rb', line 75

def link_to_empty_cart(opts = {})
  options = {
    label: 'Empty Cart',
    class: 'btn btn-danger',
    rel: :nofollow,
    data: { confirm: 'This will clear your entire cart. Are you sure?' },
    method: :delete
  }.merge(opts)

  label = options.delete(:label)
  options[:class] = ((options[:class] || '') + ' btn-empty-cart')

  link_to(label, effective_orders.cart_path, options)
end