【发布时间】:2014-09-02 19:45:42
【问题描述】:
我正在尝试使 PDF 表正常工作(以下 railscast 示例),但我收到错误 undefined methodtable' for #
这是 pdf 类库(遵循 railscast 的做法):
class FeedbackPdf < Prawn::Document
def initialize
super
text_label
pdf_feedbacks
end
def text_label
text "Customers Feedback:"
end
def pdf_feedbacks
table[[1,2],[3,4]]
end
end
谁能帮帮我?
【问题讨论】:
-
不确定,但在此doc 我看到了示例
table(data, :header => true)这意味着该表是接受一些参数的方法。根据您的代码,您尝试像这样调用table[]或smth(我的意思是Ruby 以这种方式解释您的代码)。试着写table([[1,2],[3,4]]) -
我确实尝试过 table([],[]) 但我仍然得到同样的错误。
标签: ruby-on-rails-4 prawn ruby-2.1