Class: Chop::Form::SingleFile

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



125
126
127
128
# File 'lib/chop/form.rb', line 125

def fill_in!
  assert_single_file!
  field.set file_path
end

#matches?Boolean

Returns:

  • (Boolean)


121
122
123
# File 'lib/chop/form.rb', line 121

def matches?
  field[:type] == "file" && !field[:multiple]
end