Module: ArToHtmlTable::Model::InstanceMethods

Defined in:
lib/ar_to_html_table/model.rb

Instance Method Summary collapse

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(options = {})
  @formatter = ArToHtmlTable::TableFormatter.new(self, options)
  @formatter.to_html
end