Class: Formstrap::TextareaView
- Includes:
- Hintable, InputGroupable, Labelable, Placeholderable, Validatable, Wrappable
- Defined in:
- app/models/formstrap/textarea_view.rb
Instance Method Summary collapse
Methods inherited from ViewModel
#attributes, #initialize, #to_hash
Constructor Details
This class inherits a constructor from ViewModel
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ViewModel
Instance Method Details
#input_group_options ⇒ Object
16 17 18 19 20 |
# File 'app/models/formstrap/textarea_view.rb', line 16 def .deep_merge() .deep_merge(@input_group || {}) end |
#input_options ⇒ Object
10 11 12 13 14 |
# File 'app/models/formstrap/textarea_view.rb', line 10 def keys = attributes - %i[attribute float form input_group label validate wrapper] = to_h.slice(*keys) .deep_merge() end |
#wrapper_options ⇒ Object
22 23 24 25 26 27 |
# File 'app/models/formstrap/textarea_view.rb', line 22 def .deep_merge({ class: ["mb-3", ("form-floating" if float)], data: {controller: :textarea} }).deep_merge(@wrapper || {}) end |