Я пытаюсь создать простой помощник вида, но как только я попытаюсь вложить пару тегов контента, он бросит
NoMethodError: undefined method `output_buffer=' for
def table_for(list, &proc)
t = Table.new
proc.call(t)
t.render_column(list)
end
class Table
include ActionView::Helpers::TagHelper
attr_accessor :columns, :block
def initialize
@columns = Array.new
end
def col(name)
@columns << name
end
def render_column(list)
content_tag :table do
list.each do |c|
content_tag :td, c
end
end
end
end
Любые намеки на то, что неправильно? Я также видел, что XmlBuilder - это то, что лучше для моей цели?