Sha256: a3186c939e2c1bc3f25278a0952fbd32628279a51346f7e4598a87d8043c9b51

Contents?: true

Size: 637 Bytes

Versions: 6

Compression:

Stored size: 637 Bytes

Contents

module ActiveScaffold
  module Helpers
    module ListColumnHelpers
      def active_scaffold_column_paperclip(record, column)
        paperclip = record.send(column.name.to_s)
        return nil unless paperclip.file?
        content =
          if paperclip.styles.include?(ActiveScaffold::Bridges::Paperclip::PaperclipBridgeHelpers.thumbnail_style)
            image_tag(paperclip.url(ActiveScaffold::Bridges::Paperclip::PaperclipBridgeHelpers.thumbnail_style), :border => 0)
          else
            paperclip.original_filename
          end
        link_to(content, paperclip.url, :target => '_blank')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_scaffold-3.5.5 lib/active_scaffold/bridges/paperclip/list_ui.rb
active_scaffold-3.5.4 lib/active_scaffold/bridges/paperclip/list_ui.rb
active_scaffold-3.5.3 lib/active_scaffold/bridges/paperclip/list_ui.rb
active_scaffold-3.5.2 lib/active_scaffold/bridges/paperclip/list_ui.rb
active_scaffold-3.5.1 lib/active_scaffold/bridges/paperclip/list_ui.rb
active_scaffold-3.5.0 lib/active_scaffold/bridges/paperclip/list_ui.rb