Class: Matestack::Ui::Bootstrap::Form::Textarea
- Inherits:
-
VueJs::Components::Form::Textarea
- Object
- VueJs::Components::Form::Textarea
- Matestack::Ui::Bootstrap::Form::Textarea
- Defined in:
- lib/matestack/ui/bootstrap/form/textarea.rb
Instance Method Summary collapse
- #bootstrap_textarea_attributes ⇒ Object
- #input_error_class ⇒ Object
- #render_errors ⇒ Object
- #render_form_text ⇒ Object
- #response ⇒ Object
Instance Method Details
#bootstrap_textarea_attributes ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/matestack/ui/bootstrap/form/textarea.rb', line 20 def bootstrap_textarea_attributes { class: ([:class] || "") << (" form-control"), rows: context.rows, cols: context.cols, disabled: context.disabled } end |
#input_error_class ⇒ Object
37 38 39 |
# File 'lib/matestack/ui/bootstrap/form/textarea.rb', line 37 def input_error_class 'is-invalid' end |
#render_errors ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/matestack/ui/bootstrap/form/textarea.rb', line 29 def render_errors if display_errors? div class: 'invalid-feedback', 'v-for': "error in #{error_key}" do plain '{{ error }}' end end end |
#render_form_text ⇒ Object
41 42 43 44 45 |
# File 'lib/matestack/ui/bootstrap/form/textarea.rb', line 41 def render_form_text div class: "form-text form-text-for-#{attribute_key}" do plain context.form_text end end |
#response ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/matestack/ui/bootstrap/form/textarea.rb', line 11 def response div class: "matestack-ui-bootstrap-textarea" do label input_label, ":for": id, class: "form-label" if input_label textarea .merge(textarea_attributes).merge(bootstrap_textarea_attributes) render_errors render_form_text if context.form_text end end |