Class: N::UI::Select
Class Method Summary collapse
-
.render_options(paramvalue, values, options) ⇒ Object
Generalized select.
Class Method Details
.render_options(paramvalue, values, options) ⇒ Object
Generalized select. Dont create the enclosing selects to be flexible. Example:
<select name=“param” onchange=“submit()”> # paramvalue, [-1, 1, 2, 3], [“– Enter Options –”, “Man”, “Woman”, “None”] ) </select>
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/nitro/ui/select.rb', line 23 def self.(paramvalue, values, ) str = "" values.each_with_index { |val, idx| if paramvalue == val str << %{<option value="#{val}" selected="1">#{[idx]}</option>} else str << %{<option value="#{val}">#{[idx]}</option>} end } return str end |