Sha256: 5458523b04820e4ae9f6043135bfbfa4dc561faff985275c5160d50503dedbf0

Contents?: true

Size: 359 Bytes

Versions: 24

Compression:

Stored size: 359 Bytes

Contents

class ArrayInput < SimpleForm::Inputs::StringInput
  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

  def input_type
    :text
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
flexite-0.0.5 app/simple_form/array_input.rb
flexite-0.0.4 app/simple_form/array_input.rb
flexite-0.0.3 app/simple_form/array_input.rb
flexite-0.0.2 app/simple_form/array_input.rb