handle attahcment with send_file

This commit is contained in:
Dmitriy Zaporozhets 2013-02-11 21:31:19 +02:00
parent ab0cfc0036
commit a699ebdbcc
5 changed files with 19 additions and 2 deletions

View file

@ -0,0 +1,8 @@
class FilesController < ApplicationController
def download
uploader = Note.find(params[:id]).attachment
uploader.retrieve_from_store!(params[:filename])
send_file uploader.file.path, disposition: 'attachment'
end
end