Can anyone recommend a solution for TypeError (can't convert Tempfile
into String) when I try to import a CSV file? Of course, I'm able to
import to my local Postgresql8.3 db.
Here's the code:
def csv_import
authorize! :csv_import, ImportStandard
file = params[:csv_import][:file]
logcount=0
Standard.transaction do
CSV.foreach(file, :headers => true) do |row|
Standard.create!(row.to_hash)
logcount += 1
end
end
redirect_to(...)
end
After looking at http://docs.heroku.com/constraints, I'm not sure if I
can even import CSV to my app. However, I did read a few CSV importing
related posts in the Heroku google group so I'm not giving up
hope. :-)
Thanks in advance! Cheers!
--
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.