Class: Railsboot::BaseComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::BaseComponent
- Defined in:
- app/components/railsboot/base_component.rb
Overview
ViewComponent: renders the base block.
Instance Method Summary collapse
-
#call ⇒ String
Renders the component's tag wrapping its content.
-
#initialize(tag:, **html_attributes) ⇒ BaseComponent
constructor
A new instance of BaseComponent.
Constructor Details
#initialize(tag:, **html_attributes) ⇒ BaseComponent
Returns a new instance of BaseComponent.
7 8 9 10 |
# File 'app/components/railsboot/base_component.rb', line 7 def initialize(tag:, **html_attributes) @tag = tag @html_attributes = html_attributes end |
Instance Method Details
#call ⇒ String
Renders the component's tag wrapping its content.
14 15 16 17 18 |
# File 'app/components/railsboot/base_component.rb', line 14 def call content_tag(@tag, **@html_attributes) do content end end |