I\'m using the PDFkit in my controller to build out a series of PDFs, zip them up, and then send them to the user.
In order to control the output styles, I tell PDFK
Rails.application.assets is poorly documented but it provides access to Rails' hook into Sprockets, as a Sprockets::Environment object. Rails uses Sprockets to basically run the whole asset pipeline, and this is where you should hook in for things like this:
kit.stylesheets << Rails.application.assets['application.css'].pathname
https://github.com/sstephenson/sprockets says of it:
Accessing Assets Programmatically
You can use the find_asset method (aliased as []) to retrieve an asset from a Sprockets environment. Pass it a logical path and you'll get a Sprockets::BundledAsset instance back:
environment['application.js']
# => #
Call to_s on the resulting asset to access its contents, length to get its length in bytes, mtime to query its last-modified time, and pathname to get its full path on the filesystem.