Class: Comable::OrdersController

Inherits:
ApplicationController show all
Includes:
PaymentAction, ShipmentAction
Defined in:
app/controllers/comable/orders_controller.rb

Instance Method Summary collapse

Methods included from ShipmentAction

#shipment

Methods included from PaymentAction

#payment

Instance Method Details

#createObject



26
27
28
29
30
31
32
33
34
35
# File 'app/controllers/comable/orders_controller.rb', line 26

def create
  order = current_customer.order
  if order.complete?
    flash[:notice] = I18n.t('comable.orders.success')
    send_order_complete_mail
  else
    flash[:alert] = I18n.t('comable.orders.failure')
    redirect_to comable.confirm_order_path
  end
end

#deliveryObject



19
20
21
22
23
24
# File 'app/controllers/comable/orders_controller.rb', line 19

def delivery
  case request.method_symbol
  when :post
    redirect_to next_order_path
  end
end

#ordererObject



12
13
14
15
16
17
# File 'app/controllers/comable/orders_controller.rb', line 12

def orderer
  case request.method_symbol
  when :post
    redirect_to comable.delivery_order_path
  end
end