Class: Chop::Form::Checkbox

Inherits:
Field
  • Object
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

for

Instance Method Details

#fill_in!Object



89
90
91
# File 'lib/chop/form.rb', line 89

def fill_in!
  field.set value.present?
end

#matches?Boolean

Returns:

  • (Boolean)


85
86
87
# File 'lib/chop/form.rb', line 85

def matches?
  field[:type] == "checkbox" && !field[:name].to_s.end_with?("[]")
end