Class: ShoppingCart::CartsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ShoppingCart::CartsController
- Defined in:
- app/controllers/shopping_cart/carts_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
5 |
# File 'app/controllers/shopping_cart/carts_controller.rb', line 5 def show; end |
#update ⇒ Object
7 8 9 10 11 12 |
# File 'app/controllers/shopping_cart/carts_controller.rb', line 7 def update AddCoupon.call(code: params[:coupon_code], order: current_order) do on(:ok) { redirect_to cart_path, notice: I18n.t('notice.coupon_added') } on(:invalid) { redirect_to cart_path, alert: I18n.t('notice.coupon_invalid') } end end |