wicked_pdf is not rendering header

后端 未结 1 1124
独厮守ぢ
独厮守ぢ 2021-01-18 05:51
        render :pdf => \"file_name\",
                     :layout      => \'pdf.html.erb\',
                     :template    => \'transactions/show.pdf.er         


        
相关标签:
1条回答
  • 2021-01-18 06:07

    You may want to simply render the template as a string and assign it to the header's content. Try this out:

    header: {
      content: render_to_string(template: 'header.pdf.haml')
    }
    

    It works well for me.

    0 讨论(0)
提交回复
热议问题