Class: Chop::Form::Select
- Inherits:
-
Field
- Object
- Struct
- Field
- Chop::Form::Select
show all
- Defined in:
- lib/chop/form.rb
Instance Attribute Summary
Attributes inherited from Field
#field, #label, #path, #session, #value
Instance Method Summary
collapse
Methods inherited from Field
candidates, for, from
Instance Method Details
#fill_in! ⇒ Object
100
101
102
|
# File 'lib/chop/form.rb', line 100
def fill_in!
session.select value, from: label
end
|
#get_value ⇒ Object
104
105
106
107
108
|
# File 'lib/chop/form.rb', line 104
def get_value
if selected_value = field.value
field.find("option[value='#{selected_value}']").text
end
end
|
#matches? ⇒ Boolean
96
97
98
|
# File 'lib/chop/form.rb', line 96
def matches?
field.tag_name == "select" && !field[:multiple]
end
|