3

I wrote the following code.

def help_doc
  pdf_filename = File.join(Rails.root, "/public/doc.pdf")
  send_file(pdf_filename, :filename => "doc.pdf" :type => "application/pdf", :diposition => "inline")
end

It's working, but not as I want. I'd like to view in the browser the pdf, but it's doing download of the document.

I thought that just writing :disposition => "inline" and I could see on the browser the pdf.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364

1 Answers1

3

Try removing the content disposition. You have a typo in your code, deposition vs disposition, and you're missing a comma after filename.

MatthewFord
  • 2,918
  • 2
  • 21
  • 32