相关疑难解决方法(0)

在wicked pdf中render_to_string的正确方法是什么?

这就是wicked pdf的文档规定:

WickedPdf.new.pdf_from_string(
render_to_string(:pdf => "pdf_file.pdf", :template => 'templates/pdf.html.erb', :layout => 'pdfs/layout_pdf'), 
:footer => {:content => render_to_string({:template => 'templates/pdf_footer.html.erb', :layout => 'pdfs/layout_pdf'})}
)   
Run Code Online (Sandbox Code Playgroud)

我得到的是ActionView :: MissingTemplate即使我在目录中有pdf.html.erb.我在应用程序控制器中使用gen_pdf方法,在views/application文件夹中使用等效的pdf.html.erb.我错过了什么.

ruby-on-rails-3 wicked-pdf

3
推荐指数
2
解决办法
5147
查看次数

标签 统计

ruby-on-rails-3 ×1

wicked-pdf ×1