Class: Comable::OrdersController

Inherits:
ApplicationController show all
Includes:
Decoratable
Defined in:
app/controllers/comable/orders_controller.rb

Instance Method Summary collapse

Methods included from Decoratable

included

Methods included from ApplicationHelper

#current_customer

Instance Method Details

#confirmObject



37
38
# File 'app/controllers/comable/orders_controller.rb', line 37

def confirm
end

#createObject



40
41
42
43
44
45
46
47
48
# File 'app/controllers/comable/orders_controller.rb', line 40

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

#deliveryObject



23
24
25
26
27
28
# File 'app/controllers/comable/orders_controller.rb', line 23

def delivery
  case request.method_symbol
  when :post
    redirect_to comable.payment_order_path
  end
end

#newObject



13
14
# File 'app/controllers/comable/orders_controller.rb', line 13

def new
end

#ordererObject



16
17
18
19
20
21
# File 'app/controllers/comable/orders_controller.rb', line 16

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

#paymentObject



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

def payment
  case request.method_symbol
  when :post
    redirect_to comable.confirm_order_path
  end
end