Class: UI::TextareaComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::TextareaComponent
- Includes:
- TextareaBehavior
- Defined in:
- app/view_components/ui/textarea_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(name: nil, placeholder: "", value: "", rows: nil, classes: "", **attributes) ⇒ TextareaComponent
constructor
A new instance of TextareaComponent.
Methods included from TextareaBehavior
#textarea_classes, #textarea_html_attributes
Constructor Details
#initialize(name: nil, placeholder: "", value: "", rows: nil, classes: "", **attributes) ⇒ TextareaComponent
Returns a new instance of TextareaComponent.
6 7 8 9 10 11 12 13 |
# File 'app/view_components/ui/textarea_component.rb', line 6 def initialize(name: nil, placeholder: "", value: "", rows: nil, classes: "", **attributes) @name = name @placeholder = placeholder @value = value @rows = rows @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
15 16 17 |
# File 'app/view_components/ui/textarea_component.rb', line 15 def call content_tag :textarea, @value, **textarea_html_attributes.merge(@attributes) end |