How to Pass Variable to PDF in Rails -


This question is related to some of this question. I have seen that if doing something in the rail is really hard, then you are probably doing it wrong.

I have a set of prunts and shrimp, and if I go to http: // localhost: 3000 / holder / 1. PDF I get absolutely PDF, in which I have a Variable is count , which is set manually in PDF, currently I need to pass every PDF it is created.

My attitude was to create a generator action which was to generate the PDF, but I can not seem to do such a thing. The province's documentation is below

What is the easiest way to use prawns? Is my erroneous action wrong?

Does not use a plain @ variable function? I do this all the time.

  # controller showing DF @ count = 55 response_to do | Format | Format.pdf {prawnto} end and show # pdf.prawn pdf.text @ count    

Comments