Module: ArToHtmlTable::Model::InstanceMethods
- Defined in:
- lib/ar_to_html_table/model.rb
Instance Method Summary collapse
-
#to_table(options = {}) ⇒ Object
Renders an ActiveRecord result set into an HTML table.
Instance Method Details
#to_table(options = {}) ⇒ Object
Renders an ActiveRecord result set into an HTML table
Examples
# Render all products as an HTML table
Product.all.to_table
See ArToHtmlTable::TableFormatter for options.
21 22 23 24 |
# File 'lib/ar_to_html_table/model.rb', line 21 def to_table( = {}) @table_formatter = ArToHtmlTable::TableFormatter.new(self, ) @table_formatter.to_html end |