Class: HiddenArrayInput
- Inherits:
-
SimpleForm::Inputs::StringInput
- Object
- SimpleForm::Inputs::StringInput
- HiddenArrayInput
- Defined in:
- app/inputs/hidden_array_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 16 |
# File 'app/inputs/hidden_array_input.rb', line 4 def input() [:type] ||= input_type Array(object.public_send(attribute_name)).map do |array_el| @builder.hidden_field( nil, .merge( value: array_el, name: "#{object_name}[#{attribute_name}][]" ) ) end.join.html_safe end |
#input_type ⇒ Object
18 19 20 |
# File 'app/inputs/hidden_array_input.rb', line 18 def input_type :hidden end |