Class: TaoOnRails::Components::PageComponent
- Defined in:
- lib/tao_on_rails/components/page_component.rb
Instance Attribute Summary collapse
-
#page_id ⇒ Object
readonly
Returns the value of attribute page_id.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(view, options = {}) ⇒ PageComponent
constructor
A new instance of PageComponent.
- #render(&block) ⇒ Object
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, = {} @page_id = view.page_id super end |
Instance Attribute Details
#page_id ⇒ Object (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_name ⇒ Object
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.content_tag "#{view.page_id}-page", , &block end |