Sha256: 872ae391de068f608cef42e7112a9a5f90afa9c8375346e16677a05c1fe225aa

Contents?: true

Size: 593 Bytes

Versions: 47

Compression:

Stored size: 593 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::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

47 entries across 47 versions & 2 rubygems

Version Path
active_scaffold-sequel-0.8.0 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-sequel-0.7.1 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-sequel-0.7.0 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-sequel-0.6.2 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-sequel-0.6.1 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-sequel-0.6.0 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.20 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.19 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.17 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.16 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.15 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.14 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.13 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.12 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.11 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.10 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.9 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.8 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.7 lib/active_scaffold/bridges/dragonfly/list_ui.rb
active_scaffold-3.2.6 lib/active_scaffold/bridges/dragonfly/list_ui.rb