Method: Asset#icon_path

Defined in:
lib/forge/app/models/asset.rb

#icon_pathObject



48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/forge/app/models/asset.rb', line 48

def icon_path
  case attachment_content_type
  when /image/
    attachment.url(:thumbnail)
  when /audio/
    ActionController::Base.helpers.asset_path "forge/asset-icons/audio.jpg"
  when /excel/
    ActionController::Base.helpers.asset_path "forge/asset-icons/spreadsheet.jpg"
  when /pdf/
    ActionController::Base.helpers.asset_path "forge/asset-icons/pdf.jpg"
  else
    ActionController::Base.helpers.asset_path "forge/asset-icons/misc.jpg"
  end
end