Module: TableGo::Helpers
- Defined in:
- lib/table_go/helpers.rb
Instance Method Summary collapse
- #table_go_for(collection, model_klass, options = {}, &block) ⇒ Object
- #table_rows_for(collection, model_klass, options = {}, &block) ⇒ Object
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, = {}, &block) capture do if request && request.format.csv? TableGo.render_csv(collection, model_klass, self, , &block).html_safe else TableGo.render_html(collection, model_klass, self, , &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, = {}, &block) table_go_for(collection, model_klass, .merge(:render_rows_only => true), &block) end |