Rails 3 Select Tag with List of Countries

This post is to assist to create a select tag in a view (HTML) with a list of countries.

The solution presented here:

– The countries are stored in a table in database. If you don’t want to have a table with countries in DB, you can easily modify the code below to have countries as an array in code.

– Helper to show a list of countries in select tag in HTML

 

You can find the whole solution on github.

Continue reading