I am using PDFkit with 3.1 rails. In the past, I was able to use the render_to_string function and create a pdf file from this line. Then I add style sheets as follows. My problem is that I have no idea how to access them from the asset pipeline. (So ββI did it in rails 3.0)
html_string = render_to_string(:template => "/faxes/show.html.erb", :layout => 'trade_request') kit = PDFKit.new(html_string, :page_size => 'Letter') kit.stylesheets << "#{Rails.root.to_s}/public/stylesheets/trade_request.css"
So my question is how to get direct access from my controller to my css file through the asset pipeline?
I know that I can use Rack middleware with PDFkit to render a pdf file in a browser, but in this case I need to send the PDF file to a third-party fax service.
Thank you for your help.
Ryan
ruby-on-rails pdfkit asset-pipeline
lundie
source share