Class: CytoTableHelper
- Inherits:
-
Object
- Object
- CytoTableHelper
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/cytoplasm/plugins/table.rb
Instance Method Summary collapse
- #button_row(html = "Submit", options = {}) ⇒ Object
- #header_row(html = "Title", tag = "h3", options = {}) ⇒ Object
- #td(html = "", type = nil, options = {}) ⇒ Object
- #tr(html = "", options = {}) ⇒ Object
Instance Method Details
#button_row(html = "Submit", options = {}) ⇒ Object
44 45 46 |
# File 'lib/cytoplasm/plugins/table.rb', line 44 def (html="Submit",={}) tr{td("",nil,{:colspan => "100"}){CytoButton(html,)}} 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",={}) tr{td(html,"header",){content_tag(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,={}) html = yield if block_given? if html.is_a? Hash = html html = "" elsif type.is_a? Hash = type type = nil end if type.is_a? String [:data] ||= {} [:data][:type] ||= type end content_tag("td",html,) end |
#tr(html = "", options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/cytoplasm/plugins/table.rb', line 17 def tr(html="",={}) if html.is_a? Hash = html html = "" end html = yield if block_given? content_tag("tr",html,) end |