Class: Cartify::CartsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/cartify/carts_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



5
6
7
# File 'app/controllers/cartify/carts_controller.rb', line 5

def show
  @order_items = current_order.order_items
end

#updateObject



9
10
11
12
# File 'app/controllers/cartify/carts_controller.rb', line 9

def update
  current_order.update_attributes(coupon_id: coupon.id) if coupon
  redirect_to cart_path, notice: coupon ? t('flash.coupon_applied') : t('flash.fake_coupon')
end