Maybe it's related to this issue: https://github.com/thoughtbot/paperclip/issues/issue/346
But in Rails 3.0.3 (ruby 1.9.2) I can't seem to get CSV.parse to work.
Here is sample code:
row_index = 0
CSV.parse(params[:dump][:file]) do |cells|
column_index = 0
cells.each do |cell|
column_index += 1
end
row_index += 1
end
I had to do this in Rails 3:
data = params[:dump][:file].read
CSV.parse(data)
params[:dump][:file]
is an ActionDispatch
object and can't be parsed directly by CSV.parse
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With