Module: UI::TextareaBehavior

Included in:
Textarea, TextareaComponent
Defined in:
app/helpers/ui/textarea_behavior.rb,
app/behaviors/ui/textarea_behavior.rb

Overview

UI::TextareaBehavior

Instance Method Summary collapse

Instance Method Details

#textarea_classesObject

Returns combined CSS classes for the textarea



20
21
22
23
24
25
26
27
# File 'app/helpers/ui/textarea_behavior.rb', line 20

def textarea_classes
  classes_value = respond_to?(:classes, true) ? classes : @classes
  TailwindMerge::Merger.new.merge([
    textarea_base_classes,
    classes_value

  ].compact.join(" "))
end

#textarea_html_attributesObject

Returns HTML attributes for the textarea element



10
11
12
13
14
15
16
17
# File 'app/helpers/ui/textarea_behavior.rb', line 10

def textarea_html_attributes
  {
    class: textarea_classes,
    placeholder: @placeholder,
    name: @name,
    rows: @rows
  }.compact
end