从控制器访问stylesheet_link_tag [英] Access stylesheet_link_tag from controller
本文介绍了从控制器访问stylesheet_link_tag的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否存在从控制器调用stylesheet_link_tag
的问题?我正在内存中创建PDF文件,并将其传递到对另一个服务的api调用.我正在使用PDFKit,它要求我将样式表链接发送给它.我正在使用Rails 3.1,因此需要通过此方法访问资产管道.
Is there a was to call stylesheet_link_tag
from the controller? I am creating a PDF file in memory and passing it along to an api call to another service. I am using PDFKit and it requires me to send the style sheet link to it. I am using Rails 3.1 and therefore need access to the asset pipeline through this method.
感谢您的帮助!
推荐答案
您应该可以使用它来从控制器访问样式表:
You should be able to use this to access the stylesheet from your controller:
ActionController::Base.helpers.asset_path("stylesheet_i_want.css")
这篇关于从控制器访问stylesheet_link_tag的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文