huerlisi / prawnto

a featureful rails plugin leveraging the new kickass prawn library to produce compiled pdf views

Home Page:http://cracklabs.com/prawnto

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ActionMailer integration breaks render :partial

huerlisi opened this issue · comments

At least when using something like:

    attachment "application/pdf" do |pdf|
      prawnto :prawn => { :page_size => 'A5' }
      pdf.filename = a_case.pdf_name
      pdf.body = render(:file => 'cases/show.pdf.prawn', :body => { :case => a_case})
    end

This is when the show.pdf.prawn is from cases/ which is the view directory from some ActionControler, but the ActionMailer class is called CaseMailer.

The actual error:

ActionView::TemplateError (Missing template cases/_patient_address.erb in view path app/views) on line #22 of app/views/cases/show.pdf.prawn:
[...]
22:   render :partial => 'cases/patient_address', :locals => {:parent_pdf => pdf}