Prawn pdf rendering partial results in blank page

I am trying to use the shrimp pattern style. In my main "order_summary" shrimp document, I want to make a shrimp template like this:

pdf = Prawn::Document.new(:page_size => "A4")
render :partial => "invoice"

      

The partial name is _invoice.pdf.prawn and is located in the same folder as the main document.

This results in a blank page when run. The page was displayed successfully according to the logs:

Submitted documents /_invoice.pdf.prawn(756.7ms) Rendered documents / order _summary.pdf.prawn (1100.9ms) Completed 200 OK in 2323ms (Hits: 1141.1ms | ActiveRecord: 0.4ms)

If I run the partial as "invoice.pdf.prawn" (no rendering via another file) it works fine, so I assume there is no code or sth error.

What am I doing wrong?

+3


source to share


1 answer


This is a feature described in the Prawnto wiki . Even if the partial is in the same folder, you still need to provide the full path. In your case, "documents / invoice".



+2


source







All Articles