Class: Aureus::DataTableRow
Instance Method Summary
collapse
Methods inherited from Renderable
#compact, #compact_render, #content_tag, #init
Constructor Details
Returns a new instance of DataTableRow.
74
75
76
77
78
|
# File 'lib/aureus/data_table.rb', line 74
def initialize
init_haml_helpers
@cells = Array.new
@buttons = Array.new
end
|
Instance Method Details
88
89
90
91
92
93
94
|
# File 'lib/aureus/data_table.rb', line 88
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
|
96
97
98
|
# File 'lib/aureus/data_table.rb', line 96
def button_raw content
@buttons << Renderable.new(content)
end
|
#cell(data = "", &block) ⇒ Object
80
81
82
83
84
85
86
|
# File 'lib/aureus/data_table.rb', line 80
def cell data="", &block
if block_given?
@cells << DataTableRowCell.new(capture_haml(&block))
else
@cells << DataTableRowCell.new(data)
end
end
|
#render ⇒ Object
100
101
102
|
# File 'lib/aureus/data_table.rb', line 100
def render
content_tag "tr", compact_render(*@cells)+content_tag("td",compact_render(*@buttons),:class => "buttons")
end
|