Class: OrdersController
- Inherits:
-
Spree::BaseController
- Object
- ActionController::Base
- ApplicationController
- Spree::BaseController
- OrdersController
- 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 inherited from Spree::BaseController
#access_forbidden, #default_title, #find_order, #initialize_extension_partials, #set_title, #title
Methods inherited from ApplicationController
Methods included from EasyRoleRequirementSystem
Methods included from EasyRoleRequirementSystem::InstanceMethods
Methods included from RoleRequirementSystem
Instance Method Details
#can_access? ⇒ Boolean
58 59 60 61 62 |
# File 'app/controllers/orders_controller.rb', line 58 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
45 46 47 48 49 50 51 52 |
# File 'app/controllers/orders_controller.rb', line 45 def destroy flash[:notice] = I18n.t(:basket_successfully_cleared) @order.line_items.clear @order.update_totals! after :destroy set_flash :destroy response_for :destroy end |