Sha256: 94656e724470cf883886f1a363f483da7411b4e1566b2475282840df78cc0536

Contents?: true

Size: 730 Bytes

Versions: 3

Compression:

Stored size: 730 Bytes

Contents

module FileUpload
  module TagHelper
    def multiple_file_upload_field(model_name, attribute_name, value, options = {}, &block)
      render(layout: "file_upload/tags/multiple", locals: {
        model_name: model_name,
        attribute_name: attribute_name,
        value: value,
        options: options
      }, &block)
    end

    def single_file_upload_field(model_name, attribute_name, value, options = {}, &block)
      render(layout: "file_upload/tags/single", locals: {
        model_name: model_name,
        attribute_name: attribute_name,
        value: value,
        options: options
      }, &block)
    end

    def file_size(file)
      number_with_precision(file.size / 1024.0, precision: 2)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
file_upload-0.0.3 app/helpers/file_upload/tag_helper.rb
file_upload-0.0.2 app/helpers/file_upload/tag_helper.rb
file_upload-0.0.1 app/helpers/file_upload/tag_helper.rb