Read more

Downloading files from Ruby on Rails

Dominik Schöler
July 26, 2011Software engineer at makandra GmbH

To offer files for download, use send_file.

def download(file)
  send_file file.path, :disposition => 'attachment'
end
Illustration money motivation

Opscomplete powered by makandra brand

Save money by migrating from AWS to our fully managed hosting in Germany.

  • Trusted by over 100 customers
  • Ready to use with Ruby, Node.js, PHP
  • Proactive management by operations experts
Read more Show archive.org snapshot

Note that a send_file replaces the default :render action.

Posted by Dominik Schöler to makandra dev (2011-07-26 20:19)