sorry for my English.
I follow this tattoo: http://ruportbook.com/printable_documents.html , the first example, but I get the undefined` each 'for "" method: A line all the time, I created a new file with this code:
class MultiTableController < Ruport::Controller
stage :multi_table_report
class PDF < Ruport::Formatter::PDF
renders :pdf, :for => MultiTableController
build :multi_table_report do
data.each { |table| pad(10) { draw_table(table) } }
render_pdf
end
end
end
Then, in an existing controller named worker_controller.rb, I put the following action:
def index_report
t1 = Table(%w[a b c]) << [1,2,3] << [4,5,6]
t2 = Table(%w[a b c]) << [7,8,9] << [10,11,12]
pdf = MultiTableController.render_pdf(:data => [t1,t2])
end
I added this route to route.rb, of course.
then I get this error in my browser:
undefined method `each' for "1":String
But the error occurs not only in this example, I tried many other examples, and I get the same error.
Some help? In advance! Regards.