How does one reference compiled assets from the controller in Rails 3.1?

后端 未结 6 1357
鱼传尺愫
鱼传尺愫 2020-12-09 03:50

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

6条回答
  •  离开以前
    2020-12-09 04:20

    One solution is to pull the CSS inline in your view.

    In HAML, this could look like:

    %style
      = Sass.compile(File.read(File.join(Rails.root, 'app', 'assets', 'stylesheets', 'sass', "application.scss")))
    

    Or in ERB:

    
    

提交回复
热议问题