To offer files for download, use send_file.
send_file
def download(file) send_file file.path, :disposition => 'attachment' end
Check out our e-book. Learn to structure large Ruby on Rails codebases with the tools you already know and love.
Note that a send_file replaces the default :render action.
:render