Sha256: 44a812c1a31b800844ba190ad5ae9bcfe6b3a833b44c7f42b5c6f1343929073a

Contents?: true

Size: 668 Bytes

Versions: 43

Compression:

Stored size: 668 Bytes

Contents

require 'countries'
require 'express_templates/components/forms/select'

module ExpressTemplates
  module Components
    module Forms
      class CountrySelect < Select

        def select_options
          country_options = ISO3166::Country.all.map {|country| [country.name.titleize, country.alpha2]}
          us = country_options.delete(['United States', 'US'])
          country_options.unshift us
          helpers.options_for_select(country_options, selected_value)
        end

        def select_helper_options
          add_select2_class( input_attributes.merge(include_blank: false, prompt: "-- Please Select --" ) )
        end

      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
express_admin-2.0.0.b app/components/express_admin/country_select.rb
express_admin-2.0.0.a app/components/express_admin/country_select.rb
express_admin-1.8.1 app/components/express_admin/country_select.rb
express_admin-1.8.0 app/components/express_admin/country_select.rb
express_admin-1.7.32 app/components/express_admin/country_select.rb
express_admin-1.7.31 app/components/express_admin/country_select.rb
express_admin-1.7.30 app/components/express_admin/country_select.rb
express_admin-1.7.29 app/components/express_admin/country_select.rb
express_admin-1.7.28 app/components/express_admin/country_select.rb
express_admin-1.7.27 app/components/express_admin/country_select.rb
express_admin-1.7.26 app/components/express_admin/country_select.rb
express_admin-1.7.25 app/components/express_admin/country_select.rb
express_admin-1.7.24 app/components/express_admin/country_select.rb
express_admin-1.7.23 app/components/express_admin/country_select.rb
express_admin-1.7.22 app/components/express_admin/country_select.rb
express_admin-1.7.21 app/components/express_admin/country_select.rb
express_admin-1.7.20 app/components/express_admin/country_select.rb
express_admin-1.7.19 app/components/express_admin/country_select.rb
express_admin-1.7.18 app/components/express_admin/country_select.rb
express_admin-1.7.17 app/components/express_admin/country_select.rb