Countries and Controversies
The History of Country Select
Before rails 2.0 we received a large number of tickets with modifications to the list of countries in our built in country_select helper. Some of these were people with conflicting preferences, Great Britain vs United Kingdom. Others were questions about whether we should use the english spelling or the native ones, Spain vs Espana.
These patches were a constant distraction and I was concerned about the potential for stepping into controversial issues or legal matters. To my mind there were basically two options: synchronise our list of countries with some neutral source, or remove our list of countries entirely. Given the large number of people who relied on that functionality it seemed simpler at the time to use an ISO standard, and the ISO 3166 Long Names list seemed perfect.
To my mind the ISO list was ‘completely neutral’ and an ‘impartial alternative’, it let Rails have a list that was devoid of my own personal politics. We could avoid any suggestion that we were picking sides in border disputes or questions of recognition and nicely side step the definition of ‘country’ by simply appealing to the ISO.
We received a few patches since we made the switch, and rejected them all by saying “It’s not our place to decide what a country is, please take it up with the ISO”.
Where we find ourselves
However the names of two countries on that list have caused issues for people in recent months. The first was the inclusion of “Palestinian Territories, Occupied”, and the second is the name for Taiwan as “Taiwan, Province of China”. The second issue has recently burst into life again
Given the strength of feelings on the matter we decided to remove the country_select functionality altogether from future versions of rails. Clearly the ISO 3166 list isn’t the ‘completely neutral’ list that I hoped for, and I deeply regret the offense that I’ve caused.
This controversy has been especially frustrating for me because I actually agree with those people who have been upset by this issue. It’s difficult because despite my opinions on the matter, I’ve tried to be as neutral as possible, doing my best to pick the path of least resistance. Unfortunately, it seems that I’ve failed. So here’s my attempt to fix things.
I’m reluctant to make any deviations from the list provided by the ISO organisations as it’ll open the door to several other issues which we’re not qualified to answer. Just a short list of potential complications are:
So we went back to the original decision, and chose the other path. country_select is no longer in rails, and ideally that would be the end of the matter. But to allow users to avoid errors in their applications we added a plugin.
What’s the Way Forward?
As has been pointed out repeatedly, and angrily, this just moves the issue from one git repository to another. Despite the fact that it now warns you when you install it, people will blindly install the plugin, ignore the warning, and piss people off. So I figure there are a few options:
- Choose another list of countries provided by some other authority
- Remove the plugin and break everyone’s applications come 2.2, unless they want to use the list of alternative plugins which have already sprung up
- Remove the taiwan entry from the plugin, so at least the offensive line doesn’t get displayed.
- Follow some corporate guidelines such as IBM’s
I’d appreciate any feedback from the Taiwanese rails community about what they think we should do here.


Alan Francis September 25th, 2008 @ 08:44 AM
Wonderfully, and sensitively, written.
Alex MacCaw September 25th, 2008 @ 09:36 AM
To be honest, I always regarded country_select to be part of the more bloated side of Rails. I think that sort of thing should be in a plugin, rather than in core. If it was a plugin on git, people could edit & fork it to their hearts delight.
George Anderson September 25th, 2008 @ 12:07 PM
+1 plugin
As has been pointed out repeatedly, and angrily, this just moves the issue from one git repository to another
Yes, but it’s trivial to fork the “country_select” repository and make the particular changes you see fit. It’s not a framework’s job to tip-toe through sensitive political issues and impossibly try to please everyone.
You’ve corrected what could be perceived as offensive to some and provided ample tools (the country_select plugin and git repo) for people to move forward with minimal effort.
people will blindly install the plugin, ignore the warning, and piss people off
Simply put, I don’t consider that to be Rails’ issue to resolve. At some point the responsibility for the employment of a tool is no longer with the tool designer, but rather the person wielding it. You’ve reached that point.
/g
Brandon Keepers September 25th, 2008 @ 02:16 PM
Koz,
I think you’ve done a great job of handling this sensitive topic. As you and others have suggested, the Rails community is definitely not going to come to consensus that is satisfactory to everyone. So the plugin route is great.
The only other thing I’d suggest is to have the installation warning include a URL to a github search or a wiki page with the alternative plugins.
Koz September 25th, 2008 @ 06:06 PM
The plugin route is definitely the only way forward, we just have to try to minimise the friction from here.
One option is to Reference a wiki page with a list of country_select forks instead of just linking to the current plugin. There are already a few alternatives:
I’ve notified the author of these plugins to see if he has any suggestions for releasing.
We could also link to the github search but that’s got non-rails stuff and there doesn’t seem to be a need to confuse people.
ihower September 26th, 2008 @ 03:52 AM
Thank you for listening.
The globalization guideline of IBM is the best way to avoid the culturally-sensitive issue about Taiwan/China IMHO.
Naming this helper “Country Select” seems to be bad in the beginning as it basically relying on the proper definition of “Country”, which can be political hard. Referring to our experiences in FreeBSD project, it’s way more proper to call it “Country and Region Select”, or maybe just “Region select”. Let it be a list of geographical locations instead of having any political aspects. It’s almost certain that, if “Taiwan” becomes official in Rails (whether in plugin or not) convention, some China programmer will be mad and jump out yelling “Taiwan is not a country”, and this becomes a vicious cycle. Calling it “Country and Region Selector” has at least one best advantage: It’s vague and therefore correct. “Taiwan” is definitely the name of the island. It is also what’s been done in FreeBSD and Linux.
Following some other list might be a good idea, but as a application framework, what’s decided end up populating into every single instance of application installation on earth. Even-though you claim that you’re political neutral, you’re really making decisions for other application owners, possibly without being aware of it.
One other thought: perhaps the “good default” for this is not to have any default countries, but force developer to provide the list of countries in their way, in whatever way makes their application user comfortable. The plugin can provide some different lists as configuration examples, so it can be still helpful as a “helper” be.
Best Regards.
Koz September 26th, 2008 @ 04:19 AM
Fundamentally having a list of countries (or states, or whatever) is just too painful, so going forward I’m glad it has been removed.
The catch I see is providing some option for backwards compatibility. Removing the list of countries from the plugin means we might as well remove the plugin and just tell people to ‘sort it out yourself’. I’d really prefer to avoid taking that step.
Similarly with hindsight we could have chosen another name like region_select, but making that change now will also break peoples apps so it’s equivalent to removing it without the plugin.
Another thought I had recently was to change the deprecation message, and rename the current rails plugin. So instead of pointing you at ‘country_select’ it points you to a URL on the rails site which lists several different options like
The page could have a brief description of each of those lists so each developer makes their own choice about what list they want to use. This at least means we don’t make a default choice of any sort, and any decision is made by the developers. What they choose is an entirely separate question which we have no control over.
This seems to have the benefits that we don’t foist a potentially offensive choice on our users. But we also don’t remove the option entirely.
Is that the best of a bad situation here?
hlb September 26th, 2008 @ 05:41 AM
Koz,
It is really a bright idea to avoid default and provide a clear list of options and their differences. This solution may be even better when a developer needs different kinds of foo_bar_select in one application (who knows?).
Really thank you for listening our need.
Koz September 27th, 2008 @ 01:09 AM
OK, I’m going to wait a few days to see if anyone else has some feedback, then maybe start on something early next week to implement this.
Glen Barnes October 2nd, 2008 @ 08:30 AM
When extracting it to a plugin you could also add some configuration options. Something like:
:replace => [:new_zealand => “Aotearoa”] :add => [:south_ossetia => “South Ossetia”]
You could also add several lists that could be extended and a configuration option to select a different list:
:list => :iso
or
:list => :wikipedia
This allows flexibility and won’t fork a 100 different country lists making it easier for people installing a country_select plugin.
Daniel Milks February 17th, 2009 @ 04:15 AM
Hi Koz, Just a sheepish question as to whether country_select also works well in multi-model forms? And if so, which specific steps/parameters need to be taken or supplied to make it work correctly.
I tried to implement it in a partial like this:ActionView::TemplateError (`@contact[existing_address_attributes]’ is not allowed as an instance variable name) on line #17 of contacts/_address.html.erb:
<% fields_for_address(address) do |adr_form| -%> ... 17:
Any tips would be greatly appreciated… thanks a lot! Dan
Bui Thi Xuan September 13th, 2009 @ 04:36 PM
Great post with very useful tips, but there are some errors when I chose a country, can you fix it? Thank you. Bui Thi Xuan
Leumas November 29th, 2009 @ 02:38 AM
Great post and remarks. Possibly keep in the framework for country select however make users individually add countries. But pro plugin seems more rails minded.
laowise.com