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 ⇒ String
Renders the cell with its content.
-
#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.
12 13 14 15 |
# File 'app/components/railsboot/table/cell_component.rb', line 12 def initialize(tag: DEFAULT_TAG, **html_attributes) @tag = fetch_or_raise(tag, TAGS) @html_attributes = html_attributes end |
Instance Method Details
#call ⇒ String
Renders the cell with its content.
19 20 21 |
# File 'app/components/railsboot/table/cell_component.rb', line 19 def call content_tag @tag, content, **@html_attributes end |