Class: UI::Textarea

Inherits:
Phlex::HTML
  • Object
show all
Includes:
TextareaBehavior
Defined in:
app/components/ui/textarea.rb

Instance Method Summary collapse

Methods included from TextareaBehavior

#textarea_classes, #textarea_html_attributes

Constructor Details

#initialize(placeholder: nil, value: "", name: nil, id: nil, rows: nil, classes: "", **attributes) ⇒ Textarea

Returns a new instance of Textarea.



6
7
8
9
10
11
12
13
14
# File 'app/components/ui/textarea.rb', line 6

def initialize(placeholder: nil, value: "", name: nil, id: nil, rows: nil, classes: "", **attributes)
  @placeholder = placeholder
  @value = value
  @name = name
  @id = id
  @rows = rows
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template ⇒ Object



16
17
18
# File 'app/components/ui/textarea.rb', line 16

def view_template
  textarea(**textarea_html_attributes.deep_merge(@attributes)) { @value }
end