Sha256: 4ab8aa69f90d31fdfa6cfcdce46b3e70c1c13942b146f64f0b9f4c1559fe62d2

Contents?: true

Size: 402 Bytes

Versions: 5

Compression:

Stored size: 402 Bytes

Contents

module HasVcards
  class ZipLocalityInput < SimpleForm::Inputs::StringInput
    def zip_codes
      SwissMatch.zip_codes.map { |zip| zip.to_s }.inspect
    end

    def input
      input_html_options[:type] = 'text'
      input_html_options[:autocomplete] = 'off'
      input_html_options['data-provide'] = 'typeahead'
      input_html_options['data-source'] = zip_codes

      super
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
has_vcards-1.1.2 app/input/has_vcards/zip_locality_input.rb
has_vcards-1.1.1 app/input/has_vcards/zip_locality_input.rb
has_vcards-1.1.0 app/input/has_vcards/zip_locality_input.rb
has_vcards-1.0.0 app/input/has_vcards/zip_locality_input.rb
has_vcards-1.0.0.rc0 app/input/has_vcards/zip_locality_input.rb