Class: WCC::Styles::SimpleForm::StringArrayInput

Inherits:
SimpleForm::Inputs::Base
  • Object
show all
Defined in:
lib/wcc/styles/simple_form/string_array_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/wcc/styles/simple_form/string_array_input.rb', line 3

def input(wrapper_options=nil)
  merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
  field_value = object.public_send(attribute_name)

  template.(:div, class: "selectize select-style") do
    template.text_field_tag(
      "#{base_input_name}[#{attribute_name}_facade]",
      field_value.join(','),
      "data-string-array-selectize" => "#{base_input_name}[#{attribute_name}]",
    )
  end
end