Class: OrdersController
- Inherits:
-
Spree::BaseController
- Object
- ActionController::Base
- ApplicationController
- Spree::BaseController
- OrdersController
- Includes:
- ActionView::Helpers::NumberHelper, Spree::Checkout
- Defined in:
- app/controllers/orders_controller.rb
Instance Method Summary collapse
- #can_access? ⇒ Boolean
-
#destroy ⇒ Object
override r_c default b/c we don’t want to actually destroy, we just want to clear line items.
Methods included from Spree::Checkout
#checkout, #load_checkout_steps
Methods inherited from Spree::BaseController
#access_forbidden, #find_order, #initialize_extension_partials
Methods included from EasyRoleRequirementSystem
Methods included from EasyRoleRequirementSystem::InstanceMethods
Methods included from RoleRequirementSystem
Instance Method Details
#can_access? ⇒ Boolean
57 58 59 60 61 |
# File 'app/controllers/orders_controller.rb', line 57 def can_access? return true unless order = load_object session[:order_token] ||= params[:order_token] order.grant_access?(session[:order_token]) end |
#destroy ⇒ Object
override r_c default b/c we don’t want to actually destroy, we just want to clear line items
47 48 49 50 51 52 |
# File 'app/controllers/orders_controller.rb', line 47 def destroy @order.line_items.clear respond_to do |format| format.html { redirect_to(edit_object_url) } end end |