4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/helpers/s3_relay/uploads_helper.rb', line 4
def s3_relay_field(parent, association, opts={})
file_field = file_field_tag(:file, opts.merge(class: "s3r-field"))
progress_table = content_tag(:table, "", class: "s3r-upload-list")
content = [file_field, progress_table].join
parent_type = parent.class.to_s.underscore.downcase
content_tag(:div, raw(content),
{
class: "s3r-container",
data: {
parent_type: parent_type,
parent_id: parent.id.to_s,
association: association.to_s,
disposition: opts.fetch(:disposition, "inline")
}
}
)
end
|