Class: NitroKit::RichTextArea
- Defined in:
- app/components/nitro_kit/rich_text_area.rb
Constant Summary
Constants inherited from Component
Component::ADDITIVE_DATA_ATTRIBUTES, Component::COMPONENT_OWNED_DATA_ATTRIBUTES, Component::FORBIDDEN_ATTRIBUTES, Component::RESERVED_DATA_ATTRIBUTES
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Instance Method Summary collapse
-
#initialize(content, id: nil, data: {}, aria: {}, html: {}, desperately_need_a_class: nil) ⇒ RichTextArea
constructor
A new instance of RichTextArea.
- #view_template ⇒ Object
Constructor Details
#initialize(content, id: nil, data: {}, aria: {}, html: {}, desperately_need_a_class: nil) ⇒ RichTextArea
Returns a new instance of RichTextArea.
5 6 7 8 9 |
# File 'app/components/nitro_kit/rich_text_area.rb', line 5 def initialize(content, id: nil, data: {}, aria: {}, html: {}, desperately_need_a_class: nil) @content = validate_content!(content) super(component: :rich_text_area, attributes: { id: }.compact, data:, aria:, html:, desperately_need_a_class:) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
11 12 13 |
# File 'app/components/nitro_kit/rich_text_area.rb', line 11 def content @content end |
Instance Method Details
#view_template ⇒ Object
13 14 15 16 17 |
# File 'app/components/nitro_kit/rich_text_area.rb', line 13 def view_template div(**root_attributes) do div(**slot_attributes(:editor)) { raw(content) } end end |