Class: Comable::OrdersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Comable::OrdersController
- Defined in:
- app/controllers/comable/orders_controller.rb
Instance Method Summary collapse
Methods included from ApplicationHelper
Instance Method Details
#confirm ⇒ Object
27 28 29 |
# File 'app/controllers/comable/orders_controller.rb', line 27 def confirm @order = current_customer.preorder(build_order_nested_attributes) end |
#create ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/comable/orders_controller.rb', line 31 def create @order = current_customer.order(build_order_nested_attributes) if @order.valid? flash[:notice] = I18n.t('comable.orders.success') reset_session else flash[:alert] = I18n.t('comable.orders.failure') redirect_to comable.confirm_order_path end end |
#delivery ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/controllers/comable/orders_controller.rb', line 18 def delivery case request.method_symbol when :post redirect_to comable.confirm_order_path when :get @order.order_deliveries.build if @order.order_deliveries.empty? end end |
#new ⇒ Object
8 9 |
# File 'app/controllers/comable/orders_controller.rb', line 8 def new end |
#orderer ⇒ Object
11 12 13 14 15 16 |
# File 'app/controllers/comable/orders_controller.rb', line 11 def orderer case request.method_symbol when :post redirect_to comable.delivery_order_path end end |