I m new to rails and I m currently trying to parse an uploaded file to rails. However, after I "read" the file once I cannot read it again. From what I ve read online it appears that rails immediately deletes the uploaded file. Is there a way to make the file persistent? My code is as follows
file_param = params[:sequence]
file_param.read.each do |l|
# do stuff
end
file_param.read.each do |l|
# do stuff again. this is not being called.
end
我怀着使用纸张或其他一些储存库的想法,但我不需要储存档案,只是阅读其内容。 感谢!