Reputation: 257
I'm trying to use the gem referred in the tittle to put a dropdown list with all the countries in a user creation form. I've written gem 'localized_country_select', '>= 0.9.9' in the GemFile and ran bundle install. After that, i updated the user form view with the following code:
</div>
<div class="field">
<%= f.label :country %><br>
*******<%= localized_country_select(:user, :country, [], {:include_blank => 'Please choose...'}) %>*******
</div>
When I try to access the new user page it appears me the following error:
undefined method `map' for "translation missing: en.countries":String
Well, thanks in advance guys
Upvotes: 3
Views: 200
Reputation: 72
You need locale en.rb in your config/locale. Else it wont work. Copy this to your config/locale.
https://raw.githubusercontent.com/mlitwiniuk/localized_country_select/master/locale/en.rb
Now restart your server and try.
Upvotes: 2