Class: CytoTableHelper

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/cytoplasm/plugins/table.rb

Instance Method Summary collapse

Instance Method Details

#button_row(html = "Submit", options = {}) ⇒ Object



44
45
46
# File 'lib/cytoplasm/plugins/table.rb', line 44

def button_row(html="Submit",options={})
	tr{td("",nil,{:colspan => "100"}){CytoButton(html,options)}}
end

#header_row(html = "Title", tag = "h3", options = {}) ⇒ Object



41
42
43
# File 'lib/cytoplasm/plugins/table.rb', line 41

def header_row(html="Title",tag="h3",options={})
	tr{td(html,"header",options){(tag,html)}}
end

#td(html = "", type = nil, options = {}) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/cytoplasm/plugins/table.rb', line 25

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
	("td",html,options)
end

#tr(html = "", options = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/cytoplasm/plugins/table.rb', line 17

def tr(html="",options={})
	if html.is_a? Hash
		options = html
		html = ""
	end
	html = yield if block_given?
	("tr",html,options)
end