Module: DocumentsHelper

Defined in:
app/helpers/documents_helper.rb

Instance Method Summary (collapse)

Instance Method Details



8
9
10
11
# File 'app/helpers/documents_helper.rb', line 8

def document_link(document)
  return nil if document.nil?
  link_to(document_tag(document).html_safe, document)
end

- (Object) document_tag(document)



3
4
5
6
# File 'app/helpers/documents_helper.rb', line 3

def document_tag(document)
  return nil if document.nil?
  document.document_file_file_name
end

- (Object) document_type_label(document)



17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/helpers/documents_helper.rb', line 17

def document_type_label(document)
  case document.document_file_content_type
  when 'application/pdf'
    'pdf'
  when 'application/octet-stream'
    'binary (Word or other)'
  when 'text/plain'
    'text'
  when 'text/xml'
    'xml'
  end
end

- (Object) documents_search_form



13
14
15
# File 'app/helpers/documents_helper.rb', line 13

def documents_search_form
  render('/documents/quick_search_form')
end