senny / pdfjs_viewer-rails

PDF.js viewer packaged as a Rails engine.
MIT License
114 stars 174 forks source link

Change directory path #40

Closed Qj7 closed 6 years ago

Qj7 commented 6 years ago

<iframe src="<%= pdfjs.reduced_path(file: "/name.pdf") %>"> working perfect for Rails.root.to_s + "/public/" directory. But what i can do for get documents fromRails.root.to_s + "/upload/.../" folder

senny commented 6 years ago

Hi @Qj7

Your question is not really related to this gem. pdfjs_viewer-rails requires the file to be accessible via an URL. Rails does not serve files outside public/. You have different possibilities to implement what you need:

There are tradeoffs for each approach. Please use a Rails support group or Stack Overflow to get further details on how to implement them.