I know there are several questions similar to this on stack overflow, but none seem to answer my question. The wkhtmltopdf tool apparently doesn’t know about the rails asset pipeline, and wickedPDF tries to accommodate for this by finding and managing the location of assets like images with helper methods like wicked_pdf_image_tag. However, I can’t seem to get PDFs to include images from the asset pipeline in production on Heroku. The first time around, I just gave up and pulled them from S3. I guess I can still do that but would like to figure this out.
These two view method calls work in development, but not production:
<%= image_tag image_url(@logo), style: “height:121px;” %>
<%= wicked_pdf_image_tag image_url(@logo), style: “height:121px;” %>
In development, the src those tags generate works: src=“http://localhost:3000/assets/workslogo.png”
On Heroku in prod:
src=“http://www.myapp.com/images/workslogo.png”
The error on the server is:
ActionController::RoutingError (No route matches [GET] “/images/workslogo.png”)
Any help is sincerely appreciated.
Thanks!
- Mike