Sha256: ced829bae4c15db68a7a871bef28404f6355b6205e1f31e84358d323cf3d55e2
Contents?: true
Size: 600 Bytes
Versions: 22
Compression:
Stored size: 600 Bytes
Contents
module DocumentsHelper FORMATS = ["msword","vnd.ms-powerpoint","msexcel","rar","zip","mp3","plain","pdf"] #size can be any of the names that the document has size for def thumb_for(document, size) image_tag document.thumb(size, self) end def thumb_file_for(document, size) document.thumb(size, self) end def link_for_wall(document) format = Mime::Type.lookup(document.file_content_type) url_for(document)+"."+format.to_sym.to_s+"?style=thumb0" end def wrap_file_name(name) name if(name.length > 12) name[0,12]+"..." end end end
Version data entries
22 entries across 22 versions & 2 rubygems