Sha256: d89fb1a69aa312f6685cd098e32f6baef411423a3c03b22247d9162ee79f2521
Contents?: true
Size: 898 Bytes
Versions: 6
Compression:
Stored size: 898 Bytes
Contents
module ActiveScaffold module Helpers module ListColumnHelpers def active_scaffold_column_dragonfly(record, column, ui_options: column.options) attachment = record.send(column.name.to_s) return nil if attachment.blank? content = if attachment.image? image_tag(attachment.thumb(ui_options[:thumb] || ActiveScaffold::Bridges::Dragonfly::DragonflyBridgeHelpers.thumbnail_style).url, border: 0) else attachment.name end link_to(content, dragonfly_url_for_attachment(attachment, record, column, ui_options: ui_options), target: '_blank', rel: 'noopener noreferrer') end def dragonfly_url_for_attachment(attachment, record, column, ui_options: column.options) url_method = ui_options[:private_store] ? :url : :remote_url attachment.send(url_method) end end end end
Version data entries
6 entries across 6 versions & 1 rubygems