Ask A Question

Notifications

You’re not receiving notifications from this thread.

Prawn disposition: "inline" not working

William Jones asked in Gems / Libraries

I have been following the Railscast video #153 PDFs with prawn. I want the PDF to display inline instead of down loading it, the following is my code;

def show
respond_to do |format|
format.html
format.pdf do
pdf = Prawn::Document.new
pdf.text "Origin: "+@pallet.origin_cc
send_data pdf.render, filename: "Pallet #{@pallet.id}.pdf",
type: "application/pdf",
disposition: "inline"
end
end
end

I am using rails 5.1.7, ruby 2.5.3 and prawn 2.2.2.

However the file is not shown inline but is still down loaded. What could be the cause of this?

Reply

I deleted all the old pallet data, created some new data and that displayed inline without any problem.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.