module Voltron::Upload::Field

Public Instance Methods

file_field(method, options={}) click to toggle source
Calls superclass method
# File lib/voltron/upload/action_view/field.rb, line 7
def file_field(method, options={})
  if Voltron.config.upload.enabled && !options[:default]
    template = instance_variable_get('@template')
    field = UploadField.new(@object, method, template, options)

    # +merge+ is because options is a hash with_indifferent_access, and will therefore have an 'object' attribute when converted to html
    #super method, {}.merge(field.options)
    content_tag 'v-upload', nil, field.options
  else
    options.delete(:default)
    super method, options
  end
end