Как скачать файл с send_file?
Может кто-нибудь просветить меня, как я могу скачать файл сsend_file
?
У меня есть файлimage.jpg
внутриapp/assets/images
, Я пробовал это в моем контроллере:
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
Для каждого пути написано:
ActionController::MissingFile in HomeController#download
Cannot read file 'some_path'
Что может быть проблемой здесь? Спасибо!