Open Nerian opened 2 years ago
I have this error too! Any news about that?
FWIW it works fine here – country_select
renders with "Netherlands Antilles".
Looks odd that your country_codes
in the screenshot includes "NETHERLANDS ANTILLES" instead of its country code (AN). Out of curiosity, does this work for you in a console?
>> ISO3166::Country.search("AN")
=> #<ISO3166::Country:0x0000558171c49558 @country_data_or_code="AN", @data={"translations"=>{"sv"=>"Nederländska Antillerna", "en"=>"Netherlands Antilles", "de"=>"Niederländische Antillen", "es"=>"Antillas Neerlandesas"}, "alpha2"=>"AN"}>
[1] pry(main)> ISO3166::Country.search("AN")
=> nil
countries (5.1.1)
country_select (8.0.0)
Ah, I'm on countries 5.0.0 and country_select 8.0.0.
DEV 15:29:24 >> ISO3166::Country.search("AN")
=> #<ISO3166::Country:0x00005620073169d8
@country_data_or_code="AN",
@data=
{"translations"=>
{"sv"=>"Nederländska Antillerna",
"en"=>"Netherlands Antilles",
"de"=>"Niederländische Antillen",
"es"=>"Antillas Neerlandesas"},
"alpha2"=>"AN"}>
Looks good to me, I'm on countries 5.1.1 and country_select 8.0.0.
@olleolleolle Are you sure you were running countries 5.1.1? Did you bundle exec rails c
?
I still get nil even with countries 5.1.2
[3] pry(main)> ISO3166::Country.search("AN")
=> nil
Netherlands Antilles was dissolved in 2010 and is no longer a constituent country of the Netherlands, having been split into Bonaire, Saint Eustatius and Saba (BQ), Curaçao (CW) and Sint Maarten (SX), so ISO3166::Country.search("AN")
should be nil
.
As far as I can tell, the AN
code was removed from the underlying countries
gem in 2016, and 'COTE DIVOIRE' is mis-spelled, so I'm a bit puzzled with where that list of countries comes from.
Was having same error after upgrading to Rails 7.1 today, https://github.com/countries/country_select/pull/222 seems to fix it.
https://github.com/countries/country_select/releases/tag/v8.0.3 contains the #222 PR.
Hi,
Using country_select (8.0.0)
I believe something changed with the latest release because I get an error.
I believe this happens because if this change: https://github.com/countries/country_select/commit/981cd240ed46da7c418d73831ef4b02bdff3d915#diff-b3e24e44f4100d7ed00cce762b96b5459e6db4c269a3ed31f25c71d8fbade460R102
Notice that in the country list there is
and that first value is what gets passed to the
I18n.transliterate(name), name]
. But because 'name' is null it raises.I had to add this in order to fix it for the time being.