Sha256: a3830fd7d4312992d42b5bb5fcce725c0de0a87d1b28e395ca53da0f66b99e82
Contents?: true
Size: 803 Bytes
Versions: 7
Compression:
Stored size: 803 Bytes
Contents
module ActiveScaffold module Helpers module ListColumnHelpers def active_scaffold_column_dragonfly(record, column) attachment = record.send(column.name.to_s) return nil if attachment.blank? content = if attachment.image? image_tag(attachment.thumb(column.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), :target => '_blank') end def dragonfly_url_for_attachment(attachment, record, column) url_method = column.options[:private_store] ? :url : :remote_url attachment.send(url_method) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems