Class: Railsboot::Table::CellComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::Table::CellComponent
- Defined in:
- app/components/railsboot/table/cell_component.rb
Overview
ViewComponent: renders the cell block.
Constant Summary collapse
- TAGS =
Tags.
%w[th td].freeze
- DEFAULT_TAG =
Default tag.
"td".freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(tag: DEFAULT_TAG, **html_attributes) ⇒ CellComponent
constructor
A new instance of CellComponent.
Constructor Details
#initialize(tag: DEFAULT_TAG, **html_attributes) ⇒ CellComponent
Returns a new instance of CellComponent.
9 10 11 12 |
# File 'app/components/railsboot/table/cell_component.rb', line 9 def initialize(tag: DEFAULT_TAG, **html_attributes) @tag = fetch_or_raise(tag, TAGS) @html_attributes = html_attributes end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/railsboot/table/cell_component.rb', line 14 def call content_tag @tag, content, **@html_attributes end |