Ruby on Rails Wednesday, December 1, 2010

require 'prawn'
require 'prawn/core'
require 'prawn/layout'

Prawn::Document.new do |pdf|
subtable = pdf.make_table([[ "foo", "bar" ], [ "baz", "bax" ]],
:column_widths => [ 50, 50 ]) {
column(0).background_color = "808080"
cells.borders = []
}

table = pdf.make_table([[ "foo", "bar" ], [ "baz", subtable ]],
:column_widths => [ 100, 100 ]) {
cells.border_width = 5
}
table.draw
end

When i execute the above code i am getting below mentioned error:


e:/ruby/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/graphics/color.rb:72:i
n `method_missing': undefined method `make_table' for
#<Prawn::Document:0x2e4b95
0> (NoMethodError)
from border.rb:6
from
e:/ruby/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.
rb:238:in `[]'
from
e:/ruby/lib/ruby/gems/1.8/gems/prawn-core-0.8.4/lib/prawn/document.
rb:238:in `initialize'
from border.rb:5:in `new'
from border.rb:5


In apis it is mentioned that Prawn::Document object has method
make_table.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment