Class: Chop::Form::Checkbox
- Inherits:
-
Field
- Object
- Struct
- Field
- Chop::Form::Checkbox
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
123
124
125
|
# File 'lib/chop/form.rb', line 123
def fill_in!
field.set value.present?
end
|
#get_value ⇒ Object
127
128
129
|
# File 'lib/chop/form.rb', line 127
def get_value
field.checked? ? "✓" : ""
end
|
#matches? ⇒ Boolean
119
120
121
|
# File 'lib/chop/form.rb', line 119
def matches?
field[:type] == "checkbox" && !field[:name].to_s.end_with?("[]")
end
|