Sha256: 6d1a4c65152cf26a1d8d6142d0b498f161c3721b311b0982e83208da331ab2bc

Contents?: true

Size: 517 Bytes

Versions: 11

Compression:

Stored size: 517 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

11 entries across 11 versions & 4 rubygems

Version Path
caius-celerity-0.0.6.10 lib/celerity/elements/file_field.rb
caius-celerity-0.0.6.11 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.10 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.11 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.12 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.8 lib/celerity/elements/file_field.rb
jarib-celerity-0.0.6.9 lib/celerity/elements/file_field.rb
regularfry-celerity-0.0.6.12 lib/celerity/elements/file_field.rb
walidhalabi-celerity-0.0.6.11 lib/celerity/elements/file_field.rb
walidhalabi-celerity-0.0.6.12 lib/celerity/elements/file_field.rb
walidhalabi-celerity-0.0.6.13 lib/celerity/elements/file_field.rb