Can someone enlighten me how to upload a file using send_file?
I have a file image.jpginside app/assets/images. I tried this in my controller:
def download
send_file ("#{Rails.root}/public/images/image.jpg")
end
def download
send_file ("#{Rails.root}/assets/images/image.jpg")
end
def download
send_file ("#{Rails.root}/images/image.jpg")
end
def download
send_file ("/public/images/image.jpg")
end
def download
send_file ("/assets/public/images/image.jpg")
end
def download
send_file ("/assets/images/image.jpg")
end
For each path, he says:
ActionController::MissingFile in HomeController
Cannot read file 'some_path'
What could be the problem here? Thank!
source
share