Sha256: 57c494ba51c2b8e72a3c2cbf21a969b4fda8dbb20067549eb9e1dcf9c83b61da
Contents?: true
Size: 509 Bytes
Versions: 55
Compression:
Stored size: 509 Bytes
Contents
# frozen_string_literal: true module Effective module TableRows class FileField < Effective::TableRow def content values = Array(value) - [nil, ''] if values.length > 1 values.map { |file| content_tag(:div, link_to_file(file)) }.join.html_safe elsif values.length == 1 link_to_file(values.first) end end def link_to_file(file) link_to(file.filename, template.url_for(file), target: '_blank') end end end end
Version data entries
55 entries across 55 versions & 1 rubygems