Embedding PDFs within rails page

guys,
hope, you well.
In my rails page I want to embed a PDF in my page where there are other
dynamic created informations.

I use the following code:
<% path="#{RAILS_ROOT}/manual/test.pdf" %>

But it can not open the pdf file.
Why? please take a hand in my code.
regards.

Amin

Ichikawa A. wrote:

Why? please take a hand in my code.
regards.

Amin

I think for it to be publicly accessible, the file needs to be in the
directory public. Try copying it to
rails_app_root/public/manual/test.pdf and link to it. If you require it
to be in a non-public place, you will need to use SendFile to send the
file to the browser.

Hope this helps.
mohit.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs