Method: Celerity::FileField#set

Defined in:
lib/celerity/elements/file_field.rb

#set(path) ⇒ Object

Set the file field to the given path



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/celerity/elements/file_field.rb', line 15

def set(path)
  assert_exists
  path = path.to_s

  @object.setValueAttribute path

  unless @object.getContentType
    @object.setContentType(Celerity::Util.content_type_for(path))
  end

  path
end