Class: WrapperComponent
- Defined in:
- app/components/wrapper_component.rb
Overview
Wrapper — a plain <div> with optional id/class.
Usage:
Wrapper(id: "main") { text "content" }
Wrapper(html_class: "scrollable") { text "content" }
Constant Summary
Constants inherited from Component
Instance Method Summary collapse
Methods inherited from Component
default, #initialize, #render_in, slot
Constructor Details
This class inherits a constructor from Component
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 |
# File 'app/components/wrapper_component.rb', line 12 def to_s opts = {} opts[:class] = html_class if html_class tag.div(**(**opts)) { @content } end |