I recently added a CSS file to my Rails 3.2 app, and I’m struggling with the asset pipeline.
Currently, it says ActionView::Template::Error (pdf.css isn't precompiled).
I’ve added a = require pdf to my app/assets/stylesheets/application.css file.
What else is necessary?
Do I have to add pdf.css to config.assets.precompile?
If so, why? Shouldn’t the require take care of it?
My application.css:
/*
*= require_self
*= require chosen
*= require pdf
*= require_tree ./screen
*/
Are you requiring pdf.css explicitly somewhere in your html templates?
As explained in the official guide to the asset pipeline, every file you require explicitly in the html (outside of the manifest files) needs to be compiled by adding them to
config.assets.precompile.