On Mon, Jul 21, 2008 at 12:17 PM, giorgio <[EMAIL PROTECTED]> wrote:

>
> Hi Dida,
>
> The way I have done it is to add code table type stuff into a
> migration. For example:
>  def self.up
>      countries=[["AD","Andorra"],["AE","United Arab Emirates"],
> ["AF","Afghanistan"],["AG","Antigua and Barbuda"],....etc etc.....
> ["ZA","South Africa"],["ZM","Zambia"],["ZW","Zimbabwe"]]
>      countries.sort!{|a,b| a[1]<=>b[1]}
>      countries.each do |c|
>        Country.create(:code=>c[0],:name=>c[1])
>      end
>  end
>
>  def self.down
>    Country.delete_all
>  end
>
It's quite alot actually, several thousands of zip codes of my country.


> You can also import csv files.
>
> Not sure if that helps you

 Where can i import the csv files? I didn't find a way to do that.
Thanks George.
Dida

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to