# CytoTable Helper def CytoTable(options={}) if block_given? options = Cytoplasm::addClass(options,"cytoTable") content_tag("table",options) do yield CytoTableHelper.new end else end end class CytoTableHelper include ActionView::Helpers::TagHelper def tr(html="",options={}) if html.is_a? Hash options = html html = "" end html = yield if block_given? content_tag("tr",html,options) end def td(html="",type=nil,options={}) html = yield if block_given? if html.is_a? Hash options = html html = "" elsif type.is_a? Hash options = type type = nil end if type.is_a? String options[:data] ||= {} options[:data][:type] ||= type end content_tag("td",html,options) end def header_row(html="Title",tag="h3",options={}) tr{td(html,"header",options){content_tag(tag,html)}} end def button_row(html="Submit",options={}) tr{td("",nil,{:colspan => "100"}){CytoButton(html,options)}} end end