Sha256: d12981b7e9e995487f6069ae962a907ed80a9208cc3098bbd293ac22ddc6cb25

Contents?: true

Size: 722 Bytes

Versions: 23

Compression:

Stored size: 722 Bytes

Contents

module ActiveScaffold
  module Helpers
    module ListColumnHelpers
      def active_scaffold_column_carrierwave(record, column)
        carrierwave = record.send(column.name.to_s)
        return nil if carrierwave.file.blank?
        thumbnail_style = ActiveScaffold::Bridges::Carrierwave::CarrierwaveBridgeHelpers.thumbnail_style
        content =
          if carrierwave.versions.keys.include?(thumbnail_style)
            image_tag(carrierwave.url(thumbnail_style), :border => 0)
          else
            record.send(record.send(:_mounter, column.name).send(:serialization_column))
          end
        link_to(content, carrierwave.url, :target => '_blank', rel: 'noopener noreferrer')
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
active_scaffold-3.7.0 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.20 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.19 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.17 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.15 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.14 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.13 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.12 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.11.1 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.11 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.10 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.9 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.8 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.6 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.5 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.4.1 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.4 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.3 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.2 lib/active_scaffold/bridges/carrierwave/list_ui.rb
active_scaffold-3.6.1 lib/active_scaffold/bridges/carrierwave/list_ui.rb