Top Level Namespace
Defined Under Namespace
Modules: Cytoplasm Classes: CytoTableHelper
Instance Method Summary collapse
-
#CytoButton(html = "Submit", options = {}) ⇒ Object
CytoButton Helpers.
-
#CytoColorPicker(name, value = nil, options = {}) ⇒ Object
CytoColorPicker Helpers.
-
#CytoField(name, value = nil, options = {}) ⇒ Object
CytoField Helpers.
-
#CytoRadio(name, choices, value, options = {}) ⇒ Object
CytoRadio Helper Choices should be of the syntax => "label".
-
#CytoSelect(name, option_tags = nil, options = {}) ⇒ Object
CytoSelect Helper.
-
#CytoSlider(name, value = nil, options = {}) ⇒ Object
CytoSlider Helper.
-
#CytoTable(options = {}) ⇒ Object
CytoTable Helper.
-
#CytoUpload(name, options = {}) ⇒ Object
CytoUpload Helpers.
Instance Method Details
#CytoButton(html = "Submit", options = {}) ⇒ Object
CytoButton Helpers
2 3 4 5 |
# File 'lib/cytoplasm/plugins/button.rb', line 2 def CytoButton(html="Submit",={}) = Cytoplasm::addClass(,["cytoButton","large"]) content_tag("button",html,) end |
#CytoColorPicker(name, value = nil, options = {}) ⇒ Object
CytoColorPicker Helpers
2 3 4 5 |
# File 'lib/cytoplasm/plugins/colorpicker.rb', line 2 def CytoColorPicker(name,value=nil,={}) = Cytoplasm::addClass(,"cytoColorPicker") hidden_field_tag(name,value,) end |
#CytoField(name, value = nil, options = {}) ⇒ Object
CytoField Helpers
2 3 4 5 |
# File 'lib/cytoplasm/plugins/field.rb', line 2 def CytoField(name,value=nil,={}) = Cytoplasm::addClass(,"cytoField") text_field_tag(name,value,) end |
#CytoRadio(name, choices, value, options = {}) ⇒ Object
CytoRadio Helper Choices should be of the syntax => "label"
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/cytoplasm/plugins/radio.rb', line 3 def CytoRadio(name,choices,value,={}) = Cytoplasm::addClass(,"cytoRadio") [:data] ||= {} value = choices.keys[0] if value.is_a? Hash output = "" choices.each do |v,l| o = o[:data][:label] = l output += (name,v.to_s,(value==v),o) end raw output end |
#CytoSelect(name, option_tags = nil, options = {}) ⇒ Object
CytoSelect Helper
2 3 4 5 |
# File 'lib/cytoplasm/plugins/select.rb', line 2 def CytoSelect(name,=nil,={}) = Cytoplasm::addClass(,"cytoSelect") select_tag(name,,) end |
#CytoSlider(name, value = nil, options = {}) ⇒ Object
CytoSlider Helper
2 3 4 5 |
# File 'lib/cytoplasm/plugins/slider.rb', line 2 def CytoSlider(name,value=nil,={}) = Cytoplasm::addClass(,"cytoSlider") hidden_field_tag(name,value,) end |
#CytoTable(options = {}) ⇒ Object
CytoTable Helper
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/cytoplasm/plugins/table.rb', line 3 def CytoTable(={}) if block_given? = Cytoplasm::addClass(,"cytoTable") content_tag("table",) do yield CytoTableHelper.new end else end end |
#CytoUpload(name, options = {}) ⇒ Object
CytoUpload Helpers
2 3 4 5 |
# File 'lib/cytoplasm/plugins/upload.rb', line 2 def CytoUpload(name,={}) = Cytoplasm::addClass(,"cytoUpload") file_field_tag(name,) end |