Class: Spree::BaseController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Spree::BaseController
- Defined in:
- app/controllers/spree/base_controller.rb
Direct Known Subclasses
Admin::BaseController, ContentController, CountriesController, OrdersController, PasswordResetsController, ProductsController, StatesController, TaxonsController, UserSessionsController, UsersController
Instance Method Summary collapse
- #access_forbidden ⇒ Object
-
#find_order ⇒ Object
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).
-
#initialize_extension_partials ⇒ Object
Used for pages which need to render certain partials in the middle of a view.
Methods included from EasyRoleRequirementSystem
Methods included from EasyRoleRequirementSystem::InstanceMethods
Methods included from RoleRequirementSystem
Instance Method Details
#access_forbidden ⇒ Object
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_order ⇒ Object
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_partials ⇒ Object
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 |