我最近在我的Rails 3.2應用程序中添加了一個CSS文件,而且我正在努力處理資產管道。 目前,它說ActionView::Template::Error (pdf.css isn't precompiled)
。不預編譯所需文件的資產管道
我爲我的app/assets/stylesheets/application.css
文件添加了= require pdf
。
還有什麼是必要的?
是否必須將pdf.css
添加到config.assets.precompile
?
如果是這樣,爲什麼? require
不應該照顧它嗎?
我application.css
:
/*
*= require_self
*= require chosen
*= require pdf
*= require_tree ./screen
*/
你是否需要pdf.css明確地在你的html模板中的某處? –
是的,它被一個在[wicked_pdf](https://github.com/mileszs/wicked_pdf)gem中定義的助手調用:'wicked_pdf_stylesheet_link_tag「pdf」' – asymmetric
這就是問題所在。如果你添加上面的答案,我會接受它。 – asymmetric