Class: ArrayInput

Inherits:
SimpleForm::Inputs::StringInput
  • Object
show all
Defined in:
app/simple_form/array_input.rb

Instance Method Summary collapse

Instance Method Details

#inputObject



2
3
4
5
6
7
8
# File 'app/simple_form/array_input.rb', line 2

def input
  input_html_options[:type] ||= input_type

  Array(object.public_send(attribute_name)).map do |array_el|
    @builder.text_field(nil, input_html_options.merge(value: array_el, name: "#{object_name}[#{attribute_name}][]"))
  end.join.html_safe
end

#input_typeObject



10
11
12
# File 'app/simple_form/array_input.rb', line 10

def input_type
  :text
end