Sha256: e88144a965cde619451ea1d72f6b21d0151c888b9436963b79cc6d37e234a3ea

Contents?: true

Size: 523 Bytes

Versions: 11

Compression:

Stored size: 523 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 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

11 entries across 11 versions & 2 rubygems

Version Path
social_stream-0.9.4 documents/app/helpers/documents_helper.rb
social_stream-documents-0.2.7 app/helpers/documents_helper.rb
social_stream-0.9.3 documents/app/helpers/documents_helper.rb
social_stream-0.9.2 documents/app/helpers/documents_helper.rb
social_stream-documents-0.2.6 app/helpers/documents_helper.rb
social_stream-documents-0.2.5 app/helpers/documents_helper.rb
social_stream-documents-0.2.4 app/helpers/documents_helper.rb
social_stream-documents-0.2.3 app/helpers/documents_helper.rb
social_stream-documents-0.2.0 app/helpers/documents_helper.rb
social_stream-documents-0.1.12 app/helpers/documents_helper.rb
social_stream-documents-0.1.11 app/helpers/documents_helper.rb