undefined method `table'

891 views
Skip to first unread message

Tom Lobato

unread,
Feb 9, 2009, 11:57:27 AM2/9/09
to Prawn

i`m trying the table example at home page...

require 'rubygems'
require 'prawn'
Prawn::Document.generate("fancy_table.pdf") do
data = [["Gregory Brown", "gregory...@fakemail.test" ],
["Ralph Nader" , "ra...@fakemail.test" ]]
table data,
:position => :center,
:headers => ["Name", "Email"],
:row_colors => ["ffffff","ffff00"],
:vertical_padding => 5,
:horizontal_padding => 3
end

but it returns the error:

tom@mobile:~$ ruby table-example.rb
/usr/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/graphics/color.rb:
67:in `method_missing': undefined method `table' for #<Prawn::Document:
0xb7a1333c> (NoMethodError)
from x.rb:13
from /usr/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:
115:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:
115:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:
58:in `new'
from /usr/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:
58:in `generate'
from x.rb:5

any ideas?

Jamis Buck

unread,
Feb 9, 2009, 11:58:37 AM2/9/09
to prawn...@googlegroups.com
You need to:

require 'prawn/layout'

The home page example needs to be updated.

- Jamis

Tom Lobato

unread,
Feb 9, 2009, 12:03:56 PM2/9/09
to prawn...@googlegroups.com
Jamis Buck escreveu:

> You need to:
>
> require 'prawn/layout'
>
> The home page example needs to be updated.
>
> - Jamis
>

thank you,
now it is working!

the home page says nothing about require`s, it just has the code snippet.
I think that the home could be more clear about how to run it, or could
exits
a tutorial for prawn.


Tom

Gregory Brown

unread,
Feb 9, 2009, 12:09:54 PM2/9/09
to prawn...@googlegroups.com
On Mon, Feb 9, 2009 at 12:03 PM, Tom Lobato <toml...@gmail.com> wrote:

> the home page says nothing about require`s, it just has the code snippet.
> I think that the home could be more clear about how to run it, or could
> exits
> a tutorial for prawn.

I think a tutorial / manual would be most appropriate. I'll see if I
can put something together for the 0.5 release.


--
Technical Blaag at: http://blog.majesticseacreature.com
Non-tech stuff at: http://metametta.blogspot.com
"Ruby Best Practices" Book now in O'Reilly Roughcuts:
http://rubybestpractices.com

Tom Lobato

unread,
Feb 9, 2009, 12:15:02 PM2/9/09
to prawn...@googlegroups.com
Gregory Brown escreveu:
On Mon, Feb 9, 2009 at 12:03 PM, Tom Lobato <toml...@gmail.com> wrote:

  
the home page says nothing about require`s, it just has the code snippet.
I think that the home could be more clear about how to run it, or could
exits
a tutorial for prawn.
    
I think a tutorial / manual would be most appropriate.  I'll see if I
can put something together for the 0.5 release.
  

great!
I`m using prawn for a course management system (mail, fones, names relatories, etc..)
If it can help I can send the sources for use as example, for a tutorial or examples tarball.


Tom

Gregory Brown

unread,
Feb 9, 2009, 12:16:11 PM2/9/09
to prawn...@googlegroups.com
On Mon, Feb 9, 2009 at 12:15 PM, Tom Lobato <toml...@gmail.com> wrote:

> I think a tutorial / manual would be most appropriate. I'll see if I
> can put something together for the 0.5 release.
>
>
> great!
> I`m using prawn for a course management system (mail, fones, names
> relatories, etc..)
> If it can help I can send the sources for use as example, for a tutorial or
> examples tarball.

Code samples would be great.

-greg

Tom Lobato

unread,
Feb 9, 2009, 12:18:54 PM2/9/09
to prawn...@googlegroups.com
Gregory Brown escreveu:
On Mon, Feb 9, 2009 at 12:15 PM, Tom Lobato <toml...@gmail.com> wrote:

  
I think a tutorial / manual would be most appropriate.  I'll see if I
can put something together for the 0.5 release.


great!
I`m using prawn for a course management system (mail, fones, names
relatories, etc..)
If it can help I can send the sources for use as example, for a tutorial or
examples tarball.
    
Code samples would be great.

-greg
  


ok, soon I finish the project and send the samples.



Tom



Reply all
Reply to author
Forward
0 new messages