Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.
/ country-select Public archive
forked from jamesds/country-select

This is a fork from the original (and long dead) iso-3166-country-select Rails plugin to make it available as a gem and update it as necessary.

License

Notifications You must be signed in to change notification settings

fac/country-select

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Country-Select

Gem

Compatible with Rails 5.2

Provides a simple helper to get a HTML select list of countries. The list is based on official state names used by NWG.

Users are strongly advised to evaluate the suitability of this list given their user base.

Release Process

This Gem is owned and managed by the Core Services team. Released to GitHub Packages.

Packaging is handled by Jenkins, to push a new release:

  • Create a PR that increases the version in country-select.gemspec.
  • Get that reviewed and approved.
  • Merge the PR. On a successful build, GitHub Actions will package the gem and release it to GitHub Packages.
  • Update the bundles for any applications using this gem.

See Internal Gems for more detail.

Installation

Install as a gem using

gem install country-select

Or put the following in your Gemfile

gem 'country-select'

Example

Simple use supplying model and attribute as parameters:

country_select("user", "country_name")

Supplying priority countries to be placed at the top of the list:

country_select("user", "country_name", [ "United Kingdom", "France", "Germany" ])

Supplying additiontal options:

country_select("user", "country_name", [ "United Kingdom", "France", "Germany" ], {:prompt => "Choose Country"}, {:class => "country-chooser"})

Using together with form_for or fields_for:

<%= form_for @user do |f| %>
  <%= f.country_select("country_name") %>
<% end %>

Copyright (c) 2008 Michael Koziarski, released under the MIT license

About

This is a fork from the original (and long dead) iso-3166-country-select Rails plugin to make it available as a gem and update it as necessary.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Ruby 100.0%