Sha256: e80f07e4b031d02223c72d9e1798dc3c8b718b183c59268177d6f773fad8d880

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

require 'nitro/control/attribute'

module Nitro

# Usage note:
#  don't forget to set form :method to :multipart
#  or :method to :post and :enctype to 'multipart/form-data'

class FileControl < AttributeControl
  setting :style, :default => 'width: 250px', :doc => 'The default style'

  def render
    %{
    #{emit_label}
    <input type="file" id="#{@attribute}_ctl" name="#{@attribute}" value="#{@object.send(@attribute)}"#{emit_style}#{emit_disabled} />
    }
  end
end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
nitro-0.41.0 lib/nitro/control/attribute/file.rb
nitro-0.40.0 lib/nitro/control/attribute/file.rb