Class: Comable::CartsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Comable::CartsController
- Defined in:
- app/controllers/comable/carts_controller.rb
Instance Method Summary collapse
Instance Method Details
#add ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/comable/carts_controller.rb', line 5 def add cart_item = find_cart_item return redirect_by_product_not_found unless cart_item current_customer.add_cart_item(cart_item, ) flash[:notice] = I18n.t('comable.carts.add_product') redirect_to cart_path end |
#update ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/comable/carts_controller.rb', line 15 def update cart_item = find_cart_item return redirect_by_product_not_found unless cart_item current_customer.reset_cart_item(cart_item, ) flash[:notice] = I18n.t('comable.carts.update') redirect_to cart_path end |