Top Level Namespace

Defined Under Namespace

Modules: Cytoplasm Classes: CytoTableHelper

Instance Method Summary collapse

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",options={})
  options = Cytoplasm::addClass(options,["cytoButton","large"])
  ("button",html,options)
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,options={})
  options = Cytoplasm::addClass(options,"cytoColorPicker")
  hidden_field_tag(name,value,options)
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,options={})
  options = Cytoplasm::addClass(options,"cytoField")
  text_field_tag(name,value,options)
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,options={})
  options = Cytoplasm::addClass(options,"cytoRadio")
  options[:data] ||= {}
  value = choices.keys[0] if value.is_a? Hash
  output = ""
  choices.each do |v,l|
    o = options
    o[:data][:label] = l
    output += radio_button_tag(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,option_tags=nil,options={})
  options = Cytoplasm::addClass(options,"cytoSelect")
  select_tag(name,option_tags,options)
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,options={})
  options = Cytoplasm::addClass(options,"cytoSlider")
  hidden_field_tag(name,value,options)
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(options={})
  if block_given?
    options = Cytoplasm::addClass(options,"cytoTable")
    ("table",options) 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,options={})
  options = Cytoplasm::addClass(options,"cytoUpload")
  file_field_tag(name,options)
end