In a Rails application that is deployed to Heroku I need to import a CSV.
How Can I fill the tables in Heroku with that csv?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re talking about doing this programatically, a combination of FasterCSV (built into 1.9) and ActiveRecord are your best bet.
http://blog.pioneeringsoftware.co.uk/2010/07/13/import-csv-files-in-rails-3
If you’re looking to push the CSV directly into Postgres then you need to make the file available for PG to see and then open the file from there.
http://www.postgresql.org/docs/8.2/static/sql-copy.html