<%= wicked_pdf_stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= wicked_pdf_javascript_include_tag "application", "data-turbolinks-track" => true%>
def show
@invoice_items = @invoice.accounts_receivables_items
respond_to do |format|
format.html { render :template => "invoices/show"}
format.pdf {render :pdf => "invoices/show",
:template => 'layouts/application.html', formats: :html, encoding: 'utf8', :show_as_html => params[:debug].present?}
end
end
我明白了。这是我的网页(layout / application.html),但没有<%= yield %>
内容
修改
答案 0 :(得分:1)
因为您指定了:template
作为您的布局文件,所以它会在没有视图的情况下呈现您的布局。
如何更像这样(注意模板和布局键):
render pdf: "invoice",
layout: 'layouts/application.html',
template: 'invoices/show',
formats: :html,
encoding: 'utf8',
show_as_html: params[:debug].present?