Sha256: f8b6f9e4f297e3ec4f8c5a46f072e3f76de29582dadf1bc0f554aef0d8c78e9f

Contents?: true

Size: 597 Bytes

Versions: 7

Compression:

Stored size: 597 Bytes

Contents

module ActiveScaffold
  module Helpers
    module ListColumnHelpers
      def active_scaffold_column_dragonfly(column, record)
        attachment = record.send("#{column.name}")
        return nil unless attachment.present?
        content = if attachment.image?
          image_tag(attachment.thumb(column.options[:thumb] || ActiveScaffold::Bridges::Dragonfly::Lib::DragonflyBridgeHelpers.thumbnail_style).url, :border => 0)
        else
          attachment.name
        end
        link_to(content, attachment.remote_url, {'data-popup' => true, :target => '_blank'})
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
active_scaffold-3.0.26 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb
active_scaffold-3.0.25 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb
active_scaffold_clarity-3.0.24.2 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb
active_scaffold-3.0.24 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb
active_scaffold-3.0.23 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb
active_scaffold-3.0.22 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb
active_scaffold-3.0.21 lib/active_scaffold/bridges/dragonfly/lib/list_ui.rb