Class: ShoppingCart::OrderItemsController

Inherits:
ApplicationController show all
Includes:
CurrentSession
Defined in:
app/controllers/shopping_cart/order_items_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
# File 'app/controllers/shopping_cart/order_items_controller.rb', line 7

def create
  CreateOrderItem.call(params: permited_params, order: current_order) do
    on(:ok) { render :create }
  end
end

#destroyObject



17
18
19
# File 'app/controllers/shopping_cart/order_items_controller.rb', line 17

def destroy
  @order_item.destroy
end

#updateObject



13
14
15
# File 'app/controllers/shopping_cart/order_items_controller.rb', line 13

def update
  @order_item.update(quantity: params[:quantity])
end