Ruby on Rails Wicked PDF 模板丢失错误
我目前正在使用 Rails 7 和 wicked pdf 。即使我在确切的位置有模板文件,邪恶的 pdf 也会给我一个丢失模板的错误?我做错了什么?
def show
respond_to do |format|
format.html
format.pdf do
render pdf: "file_name", template: "stocks/pdf.html.erb"
end
end
end
我做错了什么? 如果重要的话,我将 tailwindcss 与 jsbuild 一起使用。
I am currently using rails 7 with wicked pdf . wicked pdf is throwing me an missing template error even if I have template file at exact place? what am i doing wrong?
def show
respond_to do |format|
format.html
format.pdf do
render pdf: "file_name", template: "stocks/pdf.html.erb"
end
end
end
what am i doing wrong ?
I am using tailwindcss with jsbuild if that matters.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如果您的模板是
stocks/pdf.html.erb
,您的渲染应如下所示:让我知道这是否适合您。
干杯
in case your template is
stocks/pdf.html.erb
, your render should be as following:Let me know if this works for you.
Cheers