Module: TableGo::Helpers

Defined in:
lib/table_go/helpers.rb

Instance Method Summary collapse

Instance Method Details

#table_go_for(collection, model_klass, options = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/table_go/helpers.rb', line 4

def table_go_for(collection, model_klass, options = {}, &block)
  capture do
    if request && request.format.csv?
      TableGo.render_csv(collection, model_klass, self, options, &block).html_safe
    else
      TableGo.render_html(collection, model_klass, self, options, &block)
    end
  end
end

#table_rows_for(collection, model_klass, options = {}, &block) ⇒ Object



14
15
16
# File 'lib/table_go/helpers.rb', line 14

def table_rows_for(collection, model_klass, options = {}, &block)
  table_go_for(collection, model_klass, options.merge(:render_rows_only => true), &block)
end