New Discussion

Notifications

You’re not receiving notifications from this thread.

Prawn disposition: "inline" not working

1
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?

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

Join the discussion
Create an account Log in

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.