/country_tools

Primary LanguageRubyMIT LicenseMIT

CountryTools

Installation

gem 'country_tools'

Supported languages

  • French

  • English

  • Spanish

Example

Store only codes into you database.

Get all possible country codes :

CountryTools.get_all_codes

Get the name of a country by code [i18n aware] :

CountryTools.name('BE') #=> 'Belgium'

Ask if a country is in European Union :

CountryTools.in_eu?('BE') #=> true

Get options for a select (inside form_for) :

<%= f.select :country_code, CountryTools.options_for_select %>

Copyright © 2011-2019 Aurélien Malisart, released under the MIT license