You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had some issues rendering my *.html.erb templates. If I didn't specify the path as an option, it didn't know to to use the html format and would try to load .erb, without the "html. If I did specify the path, but the template loaded a partial called _.html.erb, it would have the same problem. The only solution I can find that works is to specify the template with:
@template.template_format = :html
Since all my templates are html, I have just put this in the make_pdf function within pdf_helper.rb. It could easily be setup as an option if you don't want HTML as the default template format when rendering a PDF.
The text was updated successfully, but these errors were encountered:
def show_pdf @Invoice = Invoice.find(params[:id])
get_extras
respond_to do |format|
format.html do
render :pdf => "invoice_"+params[:id],
:template => "invoices/show"
end
end
end
I had some issues rendering my *.html.erb templates. If I didn't specify the path as an option, it didn't know to to use the html format and would try to load .erb, without the "html. If I did specify the path, but the template loaded a partial called _.html.erb, it would have the same problem. The only solution I can find that works is to specify the template with:
Since all my templates are html, I have just put this in the make_pdf function within pdf_helper.rb. It could easily be setup as an option if you don't want HTML as the default template format when rendering a PDF.
The text was updated successfully, but these errors were encountered: