Module: CountrySelectEngine
- Defined in:
- lib/country-select-engine.rb,
lib/country-select-engine/engine.rb,
lib/country-select-engine/version.rb
Overview
CountrySelectEngine
View helper for displaying select list with countries:
localized_country_select(:user, :country)
Works just like the default Rails’ country_select plugin, but stores countries as country codes, not names, in the database.
You can easily translate country codes in your application like this:
<%= I18n.t @user.country, :scope => 'countries' %>
Uses the Rails internationalization framework (I18n) for translating the names of countries.
Use Rake task rake import:country_select 'de' for importing country names from Unicode.org’s CLDR repository (www.unicode.org/cldr/data/charts/summary/root.html)
Code adapted from Rails’ default country_select plugin (previously in core) See github.com/rails/country_select/tree/master/lib/country_select.rb
Defined Under Namespace
Classes: Engine
Constant Summary collapse
- VERSION =
"0.1.1"