I'm trying to generate pdf using Prawn
@buyer = Buyer.last
Prawn::Document.generate("samle.pdf") do
text "hello #{@buyer.name} world"
end
but this obviously doesn't work (only if I use class variable @@buyer), my question is what is the proper way of passing variable to Prawn::Document.generate
(I know the solution to this is prawnto but I'm experimenting little bit ...and also it's a sinatra project)