Class: TaoForm::Inputs::GroupedCollectionSelectInput

Inherits:
SimpleForm::Inputs::GroupedCollectionSelectInput
  • Object
show all
Defined in:
lib/tao_form/inputs/grouped_collection_select_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tao_form/inputs/grouped_collection_select_input.rb', line 5

def input(wrapper_options = nil)
  label_method, value_method = detect_collection_methods
  merged_html_options = merge_wrapper_options(input_html_options, wrapper_options)
  merged_component_options = component_options.merge(merged_html_options)

  template.send :tao_select, merged_component_options do
    @builder.grouped_collection_select(
      attribute_name, grouped_collection, group_method, group_label_method,
      value_method, label_method, field_options, {
        multiple: merged_component_options[:multiple],
        disabled: merged_component_options[:disabled]
      }
    )
  end
end