Reputation: 5559
I have a bunch of CVs stored on Amazon S3. The CV can be of type pdf, doc, docx, txt, rtf.
Each CV is associated with a user.
At the moment I display a link to the CV on the user's page
<p><%= link_to "View CV", @application.cv.url %></p>
Now I want to show the contents of CV, and not just a link to it.
Is this even possible?
Maybe something like
<%= render "https://s3.com/foo.pdf" %>
Upvotes: 0
Views: 70
Reputation: 14949
The approach I've taken to this is the following:
overflow-y
is set to scroll
, so the user can scroll through the pages. That way the document does not take up a huge amount of vertical space.Use a standardised naming scheme for the location of the files on S3 which includes the DB record id. Once you know the DB id and the number of pages, the HTML for the preview can be generated very simply.
There is a whole document viewer solution from the people who make Docsplit, but the instructions for getting it working were not simple, and I decided the above approach was simpler.
Upvotes: 1