<img src=“https://travis-ci.org/onomojo/i18n_country_select.svg?branch=master” alt=“Build Status” />
A simple country code select helper with I18n translations for the countries. Works exactly the same as country_select but uses country codes instead and has i18n translations for the country names.
NOTE: The old country_code_select repository that this one was forked from is outdated and no longer maintained. This i18_country_select repository is the most current.
-
Rails 3+
-
Ruby 1.9.2+
Put the following in your Gemfile
gem 'i18n_country_select'
Simple use supplying model and attribute as parameters:
country_code_select(:user, :country)
Supplying priority countries to be placed at the top of the list:
country_code_select(:user, :country, [[ 'US', 'United States' ], [ 'CA', 'Canada' ]])
Specifying different selected value:
country_code_select(:user, :country, [], selected: 'CA')
-
Brian McQuay (github.com/onomojo)
-
Brad Carson from Base 3 Media
-
Andreas Wolff (github.com/rubyphunk)
-
Valentin Rabanelly (github.com/vjrabanelly)
-
Karl-Petter Åkesson (github.com/karl-petter)
-
Hélder Tavares da Silva (github.com/heldersilva)
-
Marten Klitzke (github.com/mortik)
-
Victor D. (github.com/V1c70r)
-
Alexey Degtyarev (github.com/alexhifer)
-
Björn Wilmsmann (github.com/BjoernKW)
-
Stefan Slaveykov (github.com/wizardone)
-
Leonardo D. Schlossmacher (github.com/leods92)
-
Adam St. John (github.com/astjohn)
-
Monica Giambitto - github.com/nirnaeth
-
Marat Galiev - github.com/maratgaliev
-
Rachel Carvalho - github.com/rachel-carvalho
Based on the deprecated country_code_select by: Russ Smith ([email protected]) and Frank Wambutt ([email protected])
-
1.1.7 - Adding support for default selection
-
1.1.6 - Simplifying country code definition
-
1.1.5 - Fixing support for Rails 4.2. Adding Kosovo country code
-
1.1.4 - Fixed options being ignored when running Rails 4
-
1.1.3 - Removed Netherlands Antilles. Added Bonaire, Curacao, Sint Maarten, and South Sudan
-
1.1.2 - Adding Thread variable to speed up rendering
-
1.1.1 - Bumping required version of country translations
-
1.1.0 - Rails 4 support
-
1.0.19 - Added Macedonia
-
1.0.18 - Fixed translated sorting
-
1.0.17 - Removing duplicate country code IE
-
1.0.16 - Removing unnecessary value attribute and corrected spelling error on the include_blank option tag
-
1.0.15 - Removing more duplicate country codes
-
1.0.14 - Removing duplicate country codes and adding Norway
-
1.0.13 - Ignore missing translations from i18n-country-translations
-
1.0.12 - Adds the ability to specify text to use in a blank option
MIT or GPL