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.25 app/simple_form/array_input.rb
flexite-0.0.24 app/simple_form/array_input.rb
flexite-0.0.23 app/simple_form/array_input.rb
flexite-0.0.22 app/simple_form/array_input.rb
flexite-0.0.21 app/simple_form/array_input.rb
flexite-0.0.20 app/simple_form/array_input.rb
flexite-0.0.19 app/simple_form/array_input.rb
flexite-0.0.18 app/simple_form/array_input.rb
flexite-0.0.17 app/simple_form/array_input.rb
flexite-0.0.16 app/simple_form/array_input.rb
flexite-0.0.15 app/simple_form/array_input.rb
flexite-0.0.14 app/simple_form/array_input.rb
flexite-0.0.13 app/simple_form/array_input.rb
flexite-0.0.12 app/simple_form/array_input.rb
flexite-0.0.11 app/simple_form/array_input.rb
flexite-0.0.10 app/simple_form/array_input.rb
flexite-0.0.9 app/simple_form/array_input.rb
flexite-0.0.8 app/simple_form/array_input.rb
flexite-0.0.7 app/simple_form/array_input.rb
flexite-0.0.6 app/simple_form/array_input.rb