Class: TagsInput

Inherits:
SimpleForm::Inputs::CollectionInput
  • Object
show all
Defined in:
app/input/tags_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/input/tags_input.rb', line 4

def input(wrapper_options = {})
  @collection ||= @builder.object.send(attribute_name)
  label_method, value_method = detect_collection_methods

  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
  merged_input_options.reverse_merge!(multiple: true)

  @builder.collection_select(
    attribute_name, collection, value_method, label_method,
    input_options, merged_input_options
  )
end