Class: ExpressTemplates::Components::Forms::CountrySelect

Inherits:
Select
  • Object
show all
Defined in:
app/components/express_admin/country_select.rb

Instance Method Summary collapse

Instance Method Details

#select_helper_optionsObject



16
17
18
# File 'app/components/express_admin/country_select.rb', line 16

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

#select_optionsObject



9
10
11
12
13
14
# File 'app/components/express_admin/country_select.rb', line 9

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