Module: DocumentationHelper

Defined in:
app/helpers/documentation_helper.rb

Instance Method Summary collapse

Instance Method Details

#document_viewer_target(object) ⇒ Object



15
16
17
# File 'app/helpers/documentation_helper.rb', line 15

def document_viewer_target(object)
  viewer_documents(object).first
end


19
20
21
22
23
24
25
26
# File 'app/helpers/documentation_helper.rb', line 19

def documentation_download_link(documentation)
  return nil if documentation.nil?
  link_to(
    document_type_label(documentation.document),
    documentation.document.document_file.url(),
    title: documentation.document.document_file_file_name,
    data: {icon: :download} ) 
end


10
11
12
13
# File 'app/helpers/documentation_helper.rb', line 10

def documentation_link(documentation)
  return nil if documentation.nil?
  link_to(documentation_tag(documentation), documentation).html_safe
end


28
29
30
# File 'app/helpers/documentation_helper.rb', line 28

def documentation_links(object)
  object.documentation.collect{ |o| documentation_download_link(o)}.join(" | ").html_safe
end

#documentation_tag(documentation) ⇒ Object



3
4
5
6
7
8
# File 'app/helpers/documentation_helper.rb', line 3

def documentation_tag(documentation)
  return nil if documentation.nil?
  string = [documentation.documentation_object_type, ': ',
            object_tag(documentation.documentation_object)].join.html_safe
  string
end