I am following the first example in this tutorial: http://ruportbook.com/printable_documents.html, but I'm getting undefined method `each' for "":String 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 workers_controller.rb I have the next 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
Then, I'm getting this error on my browser:
undefined method `each' for "1":String
I have tried many others examples and I get the same error.
Some help?