我目前正在使用帶有 wicked pdf 的 rails 7 。即使我在確切的位置有模板檔案,邪惡的 pdf 也會給我一個丟失的模板錯誤?我究竟做錯了什么?
def show
respond_to do |format|
format.html
format.pdf do
render pdf: "file_name", template: "stocks/pdf.html.erb"
end
end
end
我究竟做錯了什么 ?如果這很重要,我正在使用帶有 jsbuild 的 tailwindcss。
uj5u.com熱心網友回復:
如果您的模板是stocks/pdf.html.erb,您的渲染應如下所示:
format.pdf do
render pdf: "file_name", template: "stocks/pdf", formats: [:html]
end
讓我知道這是否適合您。
干杯
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/452377.html
