Class: Spree::BaseController

Inherits:
ApplicationController show all
Defined in:
app/controllers/spree/base_controller.rb

Instance Method Summary collapse

Methods included from EasyRoleRequirementSystem

included

Methods included from EasyRoleRequirementSystem::InstanceMethods

#included

Methods included from RoleRequirementSystem

included

Instance Method Details

#access_forbiddenObject



18
19
20
# File 'app/controllers/spree/base_controller.rb', line 18

def access_forbidden
  render :text => 'Access Forbidden', :layout => true, :status => 401
end

#find_orderObject

retrieve the order_id from the session and then load from the database (or return a new order if no such id exists in the session)



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/spree/base_controller.rb', line 7

def find_order      
  unless session[:order_id].blank?
    @order = Order.find_or_create_by_id(session[:order_id])
  else      
    @order = Order.create
  end
  session[:order_id]    = @order.id
  session[:order_token] = @order.token
  @order
end

#initialize_extension_partialsObject

Used for pages which need to render certain partials in the middle of a view. Ex. Extra user form fields



24
25
26
# File 'app/controllers/spree/base_controller.rb', line 24

def initialize_extension_partials
  @extension_partials = []
end