Class: Headmin::Form::SelectView
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
18
19
20
21
22
|
# File 'app/models/headmin/form/select_view.rb', line 18
def input_group_options
default_input_group_options
.deep_merge(label_input_group_options)
.deep_merge(@input_group || {})
end
|
12
13
14
15
16
|
# File 'app/models/headmin/form/select_view.rb', line 12
def input_options
keys = attributes - %i[append attribute collection float form input_group include_blank label prepend validate selected tags wrapper]
options = to_h.slice(*keys)
default_input_options.deep_merge(options)
end
|
#select_options ⇒ Object
30
31
32
33
34
|
# File 'app/models/headmin/form/select_view.rb', line 30
def select_options
keys = %i[include_blank selected]
options = to_h.slice(*keys)
default_options.deep_merge(options)
end
|
#wrapper_options ⇒ Object
24
25
26
27
28
|
# File 'app/models/headmin/form/select_view.rb', line 24
def wrapper_options
default_wrapper_options.deep_merge({
class: ["mb-3", ("form-floating" if float)]
}).deep_merge(@wrapper || {})
end
|