Module: S3UpNow::S3UpNowHelper

Defined in:
lib/s3-upnow/form_helper.rb

Instance Method Summary collapse

Instance Method Details

#s3_upnow_field(object_name, method, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/s3-upnow/form_helper.rb', line 5

def s3_upnow_field(object_name, method, options = {})
  generator = S3UpNow::Generator.new(options)
  options[:data] ||= {}
  options[:data][:upnow] = true
  options[:data][:url] = generator.url
  options[:data][:fields] = generator.fields
  hidden_field(object_name, :"#{method}_s3_key", options.slice(:object)) +
  file_field(object_name, method, options)
end