Class: Forms::Textarea
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Forms::Textarea
- Includes:
- PhlexForms::DelegatedField
- Defined in:
- lib/forms/textarea.rb
Overview
A model-bound textarea. Thin form-binding layer over DaisyUI::Textarea.
Constant Summary
Constants included from PhlexForms::DelegatedField
PhlexForms::DelegatedField::IGNORED_MODIFIERS
Instance Method Summary collapse
-
#initialize(*modifiers, name: nil, id: nil, value: nil, error: false, disabled: false, required: false, rows: 4, full_width: true, **attributes) ⇒ Textarea
constructor
A new instance of Textarea.
- #view_template ⇒ Object
Constructor Details
#initialize(*modifiers, name: nil, id: nil, value: nil, error: false, disabled: false, required: false, rows: 4, full_width: true, **attributes) ⇒ Textarea
Returns a new instance of Textarea.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/forms/textarea.rb', line 8 def initialize(*modifiers, name: nil, id: nil, value: nil, error: false, disabled: false, required: false, rows: 4, full_width: true, **attributes) @modifiers = normalize_modifiers(modifiers) @name = name @id = id @value = value @error = error @disabled = disabled @required = required @rows = rows @full_width = full_width @attributes = attributes super() end |
Instance Method Details
#view_template ⇒ Object
23 24 25 |
# File 'lib/forms/textarea.rb', line 23 def view_template render DaisyUI::Textarea.new(*daisy_modifiers, rows: @rows, **binding_attributes) { @value } end |