lib/table_go.rb in table_go-0.2.2 vs lib/table_go.rb in table_go-0.2.3
- old
+ new
@@ -1,10 +1,9 @@
require 'table_go/version'
module TableGo
autoload :Table, 'table_go/table'
- autoload :Columns, 'table_go/columns'
autoload :Column, 'table_go/column'
autoload :TableRenderer, 'table_go/table_renderer'
autoload :Renderers, 'table_go/renderers'
autoload :Formatter, 'table_go/formatter'
autoload :Helpers, 'table_go/helpers'
@@ -17,14 +16,13 @@
def self.render_csv(collection, model_klass, options = {}, &block)
render(collection, model_klass, Renderers::CsvRenderer, nil, options, &block)
end
def self.render(collection, model_klass, renderer_klass, template, options = {}, &block)
- table = Table.new(collection, model_klass, &block)
+ table = Table.new(collection, model_klass, options, &block)
renderer = TableRenderer.new(table)
renderer.renderer_klass = renderer_klass
renderer.template = template
- renderer.apply_options(options)
renderer.render_template
end
def self.formatters
Formatter.formatters
\ No newline at end of file