WickedPDF missing layout

南笙酒味 提交于 2019-12-05 09:38:09

You need to rename your view to show.pdf.html.erb or create a new show.pdf.erb.

The .pdf in the filename lets the handler know it can use it.

Also, you probably need to use the wicked_pdf_stylesheet_link_tag helper to get your styles to show up. If you want to have a dual-purpose view, then something like this may be necessary:

<% if params[:format] && params[:format] == 'pdf' %>
  <%= wicked_pdf_stylesheet_link_tag 'application' %>
<% else %>
  <%= stylesheet_link_tag 'application' %>
<% end %>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!