mardi 2 juin 2015

How to map/iterate products' table in prawn?

I've got these lines of code:

_pdf.table(  { 
            @products.map do |product|
                [
                    ["Name:"], "#{@pdf.something1}",
                    ["Age:"], "#{@pdf.something2}",
                    ["Animal:"], "#{@pdf.something3}",
                    ["TV:"], "#{@pdf.something4}"
                ]
            end
             }

I would like to iterate or map each product in my table, but I miss something or I don't know how to do that. Please, help me find out what am I doing wrong.

Aucun commentaire:

Enregistrer un commentaire