Class: ArrayInput
- Inherits:
-
SimpleForm::Inputs::StringInput
- Object
- SimpleForm::Inputs::StringInput
- ArrayInput
- Defined in:
- app/simple_form/array_input.rb
Instance Method Summary collapse
Instance Method Details
#input ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/simple_form/array_input.rb', line 2 def input [:type] ||= input_type Array(object.public_send(attribute_name)).map do |array_el| @builder.text_field(nil, .merge(value: array_el, name: "#{object_name}[#{attribute_name}][]")) end.join.html_safe end |
#input_type ⇒ Object
10 11 12 |
# File 'app/simple_form/array_input.rb', line 10 def input_type :text end |