Class: Locomotive::Ecommerce::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Includes:
EcommerceHelper
Defined in:
app/controllers/locomotive/ecommerce/application_controller.rb

Instance Method Summary collapse

Methods included from EcommerceHelper

#as_currency, #current_user

Methods included from InventoryInterface

included

Methods included from EcommerceUrlHelper

#add_to_cart_path, #cart_path, #cart_update_path, #checkout_index_path, #checkout_path, #checkout_update_path, #confirm_order_path, #post_checkout_path, #purchases_path, #remove_from_cart_path

Methods included from EcommerceCartHelper

#current_user_cart

Instance Method Details

#authenticate_user!Object



8
9
10
11
12
13
# File 'app/controllers/locomotive/ecommerce/application_controller.rb', line 8

def authenticate_user!
  if current_user(self) == nil
    flash[:error] = "Authentication needed.  Please log in to continue."
    redirect_to cart_path
  end
end

#locomotive_user?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/controllers/locomotive/ecommerce/application_controller.rb', line 15

def locomotive_user?
  
end