# Country select with i18n

**URL:** <https://www.ruby-forum.com/t/country-select-with-i18n/173744>\
**Category:** Rails\
**Created:** [August 14, 2009, 4:08am UTC](https://www.ruby-forum.com/t/country-select-with-i18n/173744 "2009-08-14T04:08:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elioncho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ed8c4c/32.png) [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Post date:** [August 14, 2009, 4:08am UTC](https://www.ruby-forum.com/t/country-select-with-i18n/173744/1 "2009-08-14T04:08:06Z")

</div>

I am trying to manage the country names with i18n. I have a countries  
table with the countries extension codes (us., co., ve., .bo. etc…)  
and the yml files with their complete names:

en:  
countries:  
ar: Argentina  
co: Colombia  
.

I am trying to make a form with a select option for country and came  
up with this:

\<%= f.select(“country\_id”, Country.all.collect {|p| [ t  
(‘countries.’+p.code), p.id ] }, { :include\_blank =\> true }) %\>

Can anyone tell is this a clean way to do this or is there another  
way, maybe using collection\_select. Thanks,

Elías
