I have a page with several chartkick
charts which use the google charts js library which for speed purposes I copied to my server and load in the layout with a <%= javascript_include_tag 'jsapi', 'chartkick' %>
tag.
When I want to call the .pdf
extension for the middleware on a page I get the following error:
I, [2015-10-06T18:52:24.936813 #13267] INFO -- : Started GET "/javascripts/jsapi.js" for 127.0.0.1 at 2015-10-06 18:52:24 +0000
F, [2015-10-06T18:52:24.955713 #13267] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/javascripts/jsapi.js"):
Why is pdfkit looking for a route?
As an FYI, if I set disable_javascript: true
in the PDFKit initializer, I have no error rendering the page but of course the charts are not drawn.
How can I have the JS render the charts and make a PDF out of it?
INFO:
Rails 4.2 Ubuntu 14.04 wkhtmltopdf 0.9.6 pdfkit: 0.8.2 (latest)
EDIT:
This is not a duplicate of this because even with static links for the JS files (see comment) PDFKit still tries to match a route for javascripts/jsapi.js