Class: Railsboot::FormField::TextAreaComponent

Inherits:
FieldComponent
  • Object
show all
Defined in:
app/components/railsboot/form_field/text_area_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(form:, name:, **html_attributes) ⇒ TextAreaComponent

Returns a new instance of TextAreaComponent.



2
3
4
5
6
7
8
9
10
11
# File 'app/components/railsboot/form_field/text_area_component.rb', line 2

def initialize(form:, name:, **html_attributes)
  @form = form
  @name = name
  @html_attributes = html_attributes

  @html_attributes[:class] = class_names(
    "form-control",
    html_attributes[:class]
  )
end

Instance Method Details

#callObject



13
14
15
# File 'app/components/railsboot/form_field/text_area_component.rb', line 13

def call
  @form.text_area @name, **@html_attributes
end