How to open PDF file in browser ?

give :disposition => ‘inline’ in your controllers

There are several quirks with sending inline to most browsers (for
example if I remember right Firefox is still plagued by not using the
name you set for inline) and IE has several bugs that used to exist
but I don't know if that's the case. I would suggest you send it as
an attachment and let the client decide what they want to do, actually
IMO you should always send it as an attachment no matter what because
it should be up to the client what they want to do, that's why the
"open with" exists.

Adobe can catch them even if they are attached on Windows, on Linux
you won't want to view it inline anyways (at least I never do I prefer
to view it in my client rather than the browser -- or to send it
straight to Google Docs for viewing later.)

    send_data(file, type: "application/pdf", disposition: "attachment;