class TableList

Public Class Methods

new(instance) click to toggle source
# File lib/table_list.rb, line 2
def initialize(instance)
  @instance = instance
end

Public Instance Methods

headers(columns = [], widths = {}) click to toggle source
# File lib/table_list.rb, line 12
def headers(columns = [], widths = {})
  @instance.content_tag :tr do
    @instance.concat(@instance.get_table_headers(columns, widths))
  end
end
sortable_headers(columns = [], widths = {}) click to toggle source
# File lib/table_list.rb, line 6
def sortable_headers(columns = [], widths = {})
  @instance.content_tag :tr do
    @instance.concat(@instance.get_sortable_table_headers(columns, widths))
  end
end
td(data, html_options = {}) click to toggle source
# File lib/table_list.rb, line 18
def td(data, html_options = {})
  @instance.content_tag :td, data.to_s.html_safe, html_options
end
tr(html_options = {}, &block) click to toggle source
# File lib/table_list.rb, line 22
def tr(html_options = {}, &block)
  raise "need a block" unless block_given?

  result = @instance.capture do
    @instance.content_tag :tr, html_options do
      block.call(self)
    end
  end
end