Class: Comable::OrdersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Comable::OrdersController
- Includes:
- PaymentAction, PermittedAttributes, ShipmentAction, SigninAction
- Defined in:
- app/controllers/comable/orders_controller.rb
Instance Method Summary collapse
Methods included from SigninAction
Methods inherited from ApplicationController
Instance Method Details
#create ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/comable/orders_controller.rb', line 30 def create @order.next_state! flash.now[:notice] = Comable.t('orders.success') send_order_complete_mail rescue ActiveRecord::RecordInvalid flash[:alert] = @order.errors..join redirect_to next_order_path end |
#edit ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/controllers/comable/orders_controller.rb', line 14 def edit if @order.state?(params[:state]) || @order.stated?(params[:state]) render params[:state] else redirect_to next_order_path end end |
#update ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/comable/orders_controller.rb', line 22 def update if @order.stated?(params[:state]) ? @order.save : @order.next_state redirect_to next_order_path else render @order.state end end |