Class: TaoOnRails::Components::PageComponent

Inherits:
Base
  • Object
show all
Defined in:
lib/tao_on_rails/components/page_component.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#options, #view

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#html_options, #render_template, tag_name, tag_prefix, template_name, template_paths, #translate

Constructor Details

#initialize(view, options = {}) ⇒ PageComponent

Returns a new instance of PageComponent.



8
9
10
11
# File 'lib/tao_on_rails/components/page_component.rb', line 8

def initialize view, options = {}
  @page_id = view.page_id
  super
end

Instance Attribute Details

#page_idObject (readonly)

Returns the value of attribute page_id.



6
7
8
# File 'lib/tao_on_rails/components/page_component.rb', line 6

def page_id
  @page_id
end

Class Method Details

.component_nameObject



17
18
19
# File 'lib/tao_on_rails/components/page_component.rb', line 17

def self.component_name
  :page
end

Instance Method Details

#render(&block) ⇒ Object



13
14
15
# File 'lib/tao_on_rails/components/page_component.rb', line 13

def render &block
  view. "#{view.page_id}-page", options, &block
end