Class: UI::TextareaComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
TextareaBehavior
Defined in:
app/view_components/ui/textarea_component.rb

Instance Method Summary collapse

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

#callObject



15
16
17
# File 'app/view_components/ui/textarea_component.rb', line 15

def call
   :textarea, @value, **textarea_html_attributes.merge(@attributes)
end