Class: Chop::Form::MultipleSelect

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



40
41
42
43
44
45
46
47
# File 'lib/chop/form.rb', line 40

def fill_in!
  field.all("option").map(&:text).each do |value|
    session.unselect value, from: label
  end
  value.split(", ").each do |value|
    session.select value, from: label
  end
end

#matches?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/chop/form.rb', line 36

def matches?
  field.tag_name == "select" && field[:multiple]
end