Sha256: 90ad767e3779600aab65fbb606a351c3c737b20fe038e0cd63fb4e094578b91f

Contents?: true

Size: 981 Bytes

Versions: 24

Compression:

Stored size: 981 Bytes

Contents

module ActiveScaffold
  module Helpers
    # Helpers that assist with the rendering of a List Column
    module ListColumnHelpers
      def active_scaffold_column_download_link_with_filename(record, column)
        return nil if record.send(column.name).nil?
        active_scaffold_column_download_link(record, column, File.basename(record.send(column.name)))
      end
      
      def active_scaffold_column_download_link(record, column, label = nil)
        return nil if record.send(column.name).nil?
        label||=as_(:download)
        link_to( label, url_for_file_column(record, column.name.to_s), :popup => true)
      end
      
      def active_scaffold_column_thumbnail(record, column)
        return nil if record.send(column.name).nil?
        link_to( 
          image_tag(url_for_file_column(record, column.name.to_s, "thumb"), :border => 0), 
          url_for_file_column(record, column.name.to_s), 
          :popup => true)
      end
      
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
active_scaffold-3.4.17 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.16 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.14 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.13 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.12 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.11 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.10 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.9 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.8 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.7 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.5 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.4 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.3 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.2 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.1 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.0.1 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.4.0 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.3.3 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.3.2 lib/active_scaffold/bridges/file_column/list_ui.rb
active_scaffold-3.3.1 lib/active_scaffold/bridges/file_column/list_ui.rb