Sha256: 50bb42b5b735605ff06748665b7e17dc2d760c19664dd7ea7f96e07f0d7f75d1

Contents?: true

Size: 714 Bytes

Versions: 23

Compression:

Stored size: 714 Bytes

Contents

module DocumentsHelper
  
  # Return document thumbnail/icon
  def document_image_tag(document)
    if !(document.attachment.content_type =~ /^image/).nil? 
      image_tag document.attachment(:micro)
    else
      image_tag 'icons/file_extension/file_extension_' + (Document::FILE_EXTENSION_ICON[document.attachment.content_type].presence || '') + '.png'
    end
  end

  # Return document thumbnail/icon
  def document_image_path(document)
    if !(document.attachment.content_type =~ /^image/).nil? 
      document.attachment(:micro)
    else
      '/assets/icons/file_extension/file_extension_' + (Document::FILE_EXTENSION_ICON[document.attachment.content_type].presence || '') + '.png'
    end
  end

  
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rich_table_component-0.0.30 app/helpers/documents_helper.rb
rich_table_component-0.0.29 app/helpers/documents_helper.rb
rich_table_component-0.0.28 app/helpers/documents_helper.rb
rich_table_component-0.0.27 app/helpers/documents_helper.rb
rich_table_component-0.0.26 app/helpers/documents_helper.rb
rich_table_component-0.0.24 app/helpers/documents_helper.rb
rich_table_component-0.0.22 app/helpers/documents_helper.rb
rich_table_component-0.0.21 app/helpers/documents_helper.rb
rich_table_component-0.0.18 app/helpers/documents_helper.rb
rich_table_component-0.0.17 app/helpers/documents_helper.rb
rich_table_component-0.0.16 app/helpers/documents_helper.rb
rich_table_component-0.0.15 app/helpers/documents_helper.rb
rich_table_component-0.0.14 app/helpers/documents_helper.rb
rich_table_component-0.0.13 app/helpers/documents_helper.rb
rich_table_component-0.0.10 app/helpers/documents_helper.rb
rich_table_component-0.0.9 app/helpers/documents_helper.rb
rich_table_component-0.0.8 app/helpers/documents_helper.rb
rich_table_component-0.0.7 app/helpers/documents_helper.rb
rich_table_component-0.0.6 app/helpers/documents_helper.rb
rich_table_component-0.0.5 app/helpers/documents_helper.rb