Module: InstantUpload::Helpers::UploadHelper

Defined in:
lib/instant_upload/helpers/upload_helper.rb

Instance Method Summary collapse

Instance Method Details

#instant_upload_for(record, field, options = {}) ⇒ Object



6
7
8
9
# File 'lib/instant_upload/helpers/upload_helper.rb', line 6

def instant_upload_for(record, field, options = {})
  partial ||= options[:multi].present? ? 'instant_upload/multi' : 'instant_upload/single'
  render partial: partial, locals: { record: record, field: field, options: { field: field, persisted: record.persisted?.to_s }.merge(options) }
end