Q:

Ruby on rails : Display a pdf file

I am uploading PDF files using paperclip, how do I display them after?
This is the error I get:
ActionController::RoutingError (No route matches [GET] "/public/uploads/6/test.pdf"):
I mean ok I know it's a routing error but do I have to define a route for every file? it doesn't make sense to me

A:

You do not have to define a route to it, just link to it properly just like you would an image
Your url linking to the asset is incorrect.  Remove the /pulbic so it looks like below.
'/uploads/6/test.pdf'

