Module: DocumentsHelper
- Defined in:
- app/helpers/documents_helper.rb
Instance Method Summary collapse
-
#document_image_path(document) ⇒ Object
Return document thumbnail/icon.
-
#document_image_tag(document) ⇒ Object
Return document thumbnail/icon.
Instance Method Details
#document_image_path(document) ⇒ Object
Return document thumbnail/icon
13 14 15 16 17 18 19 |
# File 'app/helpers/documents_helper.rb', line 13 def document_image_path(document) if !(document..content_type =~ /^image/).nil? document.(:micro) else '/assets/icons/file_extension/file_extension_' + (Document::FILE_EXTENSION_ICON[document..content_type].presence || '') + '.png' end end |
#document_image_tag(document) ⇒ Object
Return document thumbnail/icon
4 5 6 7 8 9 10 |
# File 'app/helpers/documents_helper.rb', line 4 def document_image_tag(document) if !(document..content_type =~ /^image/).nil? image_tag document.(:micro) else image_tag 'icons/file_extension/file_extension_' + (Document::FILE_EXTENSION_ICON[document..content_type].presence || '') + '.png' end end |