= select_tag(:country, options_for_select(Country.all))
Country[user.citizenship].nationality
Country[user.country].name # gives the country name
- Note that some countries don't have nationalities...
- Note that some countries share the same nationalities...
nationalities = Country.all do |country|
country = Country[country.first] # it's weird but that's the way it is...
country.nationality.present? ? [country.nationality, country.alpha2] : [country.name, country.alpha2]
end
@nationalities_options = nationalities.sort { |a,b| a[0] <=> b[0] }