Class: OrdersController

Inherits:
Spree::BaseController show all
Includes:
ActionView::Helpers::NumberHelper, Spree::Checkout
Defined in:
app/controllers/orders_controller.rb

Instance Method Summary collapse

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

included

Methods included from EasyRoleRequirementSystem::InstanceMethods

#included

Methods included from RoleRequirementSystem

included

Instance Method Details

#can_access?Boolean

Returns:

  • (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

#destroyObject

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