The “a.body” appears to want a string, which is why I tried
render_to_string as shown in the code linked above.
This doesn’t work, I get “undefined method for render_to_string”.
I basically need to attach a PDF that is generated in another
controller, passing ‘data’ as parameters for which the PDF generating
engine will use.
I am able to otherwise send e-mails with ActionMailer, and generate this
PDF. I just can’t attach the PDF to the e-mail.
The API says it wants:
a.body = generate_your_pdf_here()
How to do I replace the “generate_your_pdf_here()” with what is produced
by the action ‘print_pdf’ in the ‘report’ controller?
Thanks in advance!