Class: Formular::Element::Select
- Includes:
- Modules::Collection, HtmlEscape
- Defined in:
- lib/formular/elements.rb
Overview
class Input
Direct Known Subclasses
Constant Summary
Constants included from HtmlEscape
HtmlEscape::HTML_ESCAPE, HtmlEscape::HTML_ESCAPE_ONCE_REGEXP, HtmlEscape::HTML_ESCAPE_REGEXP
Instance Method Summary collapse
-
#option_tags ⇒ Object
convert the collection array into option tags also supports option groups when the array is nested example 1: [[1,“True”], [0,“False”]] => <option value=“1”>true</option><option value=“0”>false</option> example 2: [ [“Genders”, [[“m”, “Male”], [“f”, “Female”]]], [“Booleans”, [[1,“true”], [0,“false”]]] ] => <optgroup label=“Genders”> <option value=“m”>Male</option> <option value=“f”>Female</option> </optgroup> <optgroup label=“Booleans”> <option value=“1”>true</option> <option value=“0”>false</option> </optgroup>.
Methods included from HtmlEscape
#html_escape, #html_escape_once
Methods included from Module
Instance Method Details
#option_tags ⇒ Object
convert the collection array into option tags also supports option groups when the array is nested example 1:
- [1,“True”], [0,“False”]
-
>
<option value=“1”>true</option><option value=“0”>false</option> example 2: [
["Genders", [["m", "Male"], ["f", "Female"]]],
["Booleans", [[1,"true"], [0,"false"]]]
] => <optgroup label=“Genders”>
<option value="m">Male</option>
<option value="f">Female</option>
</optgroup> <optgroup label=“Booleans”>
<option value="1">true</option>
<option value="0">false</option>
</optgroup>
219 220 221 |
# File 'lib/formular/elements.rb', line 219 def ([:collection]) end |