Class: Corzinus::CartsController
Instance Method Summary
collapse
Methods included from Flashable
#flash_render
#authenticate_corzinus_person!, #current_person
Instance Method Details
#edit ⇒ Object
5
6
7
|
# File 'app/controllers/corzinus/carts_controller.rb', line 5
def edit
@coupon_form = CouponForm.from_model(current_order.coupon)
end
|
#update ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/corzinus/carts_controller.rb', line 9
def update
UpdateOrder.call(current_order, params) do
on(:valid) { success_update(:edit_cart) }
on(:to_checkout) { success_update(:checkout, :address) }
on(:invalid) do |coupon_form|
expose coupon_form: coupon_form
flash_render :edit, alert: t('corzinus.flash.failure.cart_update')
end
end
end
|