Class: EffectiveSelectInput

Inherits:
SimpleForm::Inputs::CollectionSelectInput
  • Object
show all
Defined in:
app/models/inputs/effective_select_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/models/inputs/effective_select_input.rb', line 7

def input(wrapper_options = nil)
  label_method, value_method = (detect_collection_methods rescue [:to_s, :to_s])

  options[:collection] = collection
  options[:label_method] = label_method unless options[:polymorphic]
  options[:value_method] = value_method unless options[:polymorphic]

  Inputs::EffectiveSelect::Input.new(object, object_name, template, attribute_name, input_options, (merge_wrapper_options(input_html_options, wrapper_options) || {})).to_html
end