Module: RenderComponent::Components

Defined in:
lib/render_component/components.rb

Defined Under Namespace

Modules: ClassMethods, HelperMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/render_component/components.rb', line 3

def self.included(base) #:nodoc:
  base.class_eval do
    include InstanceMethods
    extend ClassMethods
    helper HelperMethods

    # If this controller was instantiated to process a component request,
    # +parent_controller+ points to the instantiator of this controller.
    attr_accessor :parent_controller

    alias_method_chain :session, :render_component
    alias_method_chain :flash, :render_component
    alias_method :component_request?, :parent_controller
  end
end