Module: Handcart::ControllerAdditions

Defined in:
lib/handcart/controller_additions.rb

Overview

This module is automatically included into all controllers.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



43
44
45
46
# File 'lib/handcart/controller_additions.rb', line 43

def self.included(base)
  base.extend ClassMethods
  base.helper_method :current_subdomain, :current_handcart
end

Instance Method Details

#current_handcartObject



39
40
41
# File 'lib/handcart/controller_additions.rb', line 39

def current_handcart
  @current_handcart = current_subdomain.handcart
end

#current_subdomainObject

Instance Methods here



35
36
37
# File 'lib/handcart/controller_additions.rb', line 35

def current_subdomain
  @current_subdomain = Handcart::Subdomain.find_by_name(request.subdomain)
end