class Aureus::Components::DataTableRow

Public Class Methods

new() click to toggle source
# File lib/aureus/components/data_table.rb, line 60
def initialize
  init_haml_helpers
  @cells = Array.new
  @buttons = Array.new
  @identifier = ''
end

Public Instance Methods

button(type_or_title, url, *args) click to toggle source
# File lib/aureus/components/data_table.rb, line 79
def button(type_or_title, url, *args)
  if type_or_title.is_a? Symbol
    @buttons << DataTableRowButton.new(type_or_title,type_or_title.to_s,url,args)
  else
    @buttons << DataTableRowButton.new(:text,type_or_title.to_s,url,args)
  end
end
button_raw(content) click to toggle source
# File lib/aureus/components/data_table.rb, line 87
def button_raw(content)
  @buttons << Renderable.new(content)
end
cell(data='', &block) click to toggle source
# File lib/aureus/components/data_table.rb, line 71
def cell(data='', &block)
  if block
    @cells << DataTableRowCell.new(capture_haml(&block))
  else
    @cells << DataTableRowCell.new(data)
  end
end
identifier(value) click to toggle source
# File lib/aureus/components/data_table.rb, line 67
def identifier(value)
  @identifier = value
end
render() click to toggle source
# File lib/aureus/components/data_table.rb, line 91
def render
  content_tag 'tr', compact_render(*@cells)+content_tag('td',compact_render(*@buttons),class: 'buttons'), id: @identifier
end