Sha256: d6f532710e5c22367c753b1278db6d4a9d3622f165eb77b16f7d787672664a92
Contents?: true
Size: 781 Bytes
Versions: 9
Compression:
Stored size: 781 Bytes
Contents
# Adds method to Array to allow output of html tables - only works # if the array is an ActiveRecord result set. See ArToHtmlTable::TableFormatter module ArToHtmlTable module Model def self.included(base) base.class_eval do extend ClassMethods include InstanceMethods end end module InstanceMethods # 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. def to_table(options = {}) @formatter = ArToHtmlTable::TableFormatter.new(self, options) @formatter.to_html end end module ClassMethods end end end
Version data entries
9 entries across 9 versions & 1 rubygems