[ruby-it] Problema banale con le variabili
Andrea Longhi
andrea74 a mailshack.com
Gio 11 Giu 2009 00:50:23 CEST
> def pdf
> numero = Invoice.find(:all, :order=>'number')
> _pdf = PDF::Writer.new
> _pdf.select_font "Times-Roman"
> _pdf.text "Studio Faletra", :font_size => 20, :justification =>
> :left
> _pdf.line(50, 690, 560, 690).stroke
>
>
>
> send_data _pdf.render, :filename => "#{numero.number}.pdf", :type =>
> "application/pdf"
> end
Leggo distrattamente ma mi pare di vedere un errore: la variabile numero
è associata ad una colletion di invoices, mentre poi chiami
numero.number che dubito sia un metodo relativo ad una collection...
--
Posted via http://www.ruby-forum.com/.
More information about the Ml
mailing list