Sha256: 1da26cecde1e3b5a25ad536cb5b6a7af54e3031bab507491b4931cbab79bbd53

Contents?: true

Size: 524 Bytes

Versions: 15

Compression:

Stored size: 524 Bytes

Contents

module Celerity
  
  #
  # For fields that accept file uploads
  #

  class FileField < InputElement
    TAGS = [ Identifier.new('input', :type => %w[file]) ]
    DEFAULT_HOW = :name

    #
    # Set the file field to the given path
    # 

    def set(path)
      assert_exists
      path = path.to_s
      @container.update_page @object.setValueAttribute(path)
      unless @object.getContentType
        @object.setContentType(Celerity::Util.content_type_for(path))
      end
    end
    
  end # FileField
end # Celerity

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
jarib-celerity-0.0.5.10 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.5.11 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.5.6 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.5.7 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.5.8 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.5.9 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.1 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.2 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.3 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.4 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.5 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.6 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.7 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6 lib/celerity/elements/file_field.rb
celerity-0.0.6 lib/celerity/elements/file_field.rb