I\'m looking for a simple way to upload a file (an xml file) to the public directory of Rails 3. Once it\'s there I want to open it, parse the contents and delete the file a
I received an error indicating "undefined method `cp' for File:Class". Realized that this should actually be updated as follows:
Right code for file_uplad method:
def file_upload
tmp = params[:file_upload][:my_file].tempfile
require 'ftools'
file = File.join("public", params[:file_upload][:my_file].original_filename)
FileUtils.cp tmp.path, file
end