All threads / Prawn disposition: "inline" not working

Ask A Question


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.pdf do
pdf =
pdf.text "Origin: "[email protected]_cc
send_data pdf.render, filename: "Pallet #{}.pdf",
type: "application/pdf",
disposition: "inline"

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

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.