Sha256: 3aa7dca881a8eab3169a89dc402aa6fecd4521e44ca3261e7ca2f79998bc068b

Contents?: true

Size: 981 Bytes

Versions: 108

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(column, record)
        return nil if record.send(column.name).nil?
        active_scaffold_column_download_link(column, record, File.basename(record.send(column.name)))
      end
      
      def active_scaffold_column_download_link(column, record, 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(column, record)
        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

108 entries across 108 versions & 7 rubygems

Version Path
active_scaffold_vho-4.0.0 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.14 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.13 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.12 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.11 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.10 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.9 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.8 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.7 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.6 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.5 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.4 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.3 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.2 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.1 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.2.0 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.0.31 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold_vho-3.1.8 lib/active_scaffold/bridges/file_column/lib/list_ui.rb
active_scaffold-3.2.20 lib/active_scaffold/bridges/file_column/list_ui.rb
brisk-bills-0.8.2 vendor/plugins/active_scaffold/lib/bridges/file_column/lib/list_ui.rb