Module: FileAttachmentsHelper

Defined in:
app/helpers/file_attachments_helper.rb

Instance Method Summary collapse

Instance Method Details

#description_display(file_attachment) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/file_attachments_helper.rb', line 3

def description_display(file_attachment)
  return unless has_authorization?(:read, file_attachment)
   :p, {
    :id => "file_attachment_#{file_attachment.id}_description",
    :class => 'file_attachment_description'
  } do
    file_attachment.description
  end
end

#file_container_data(file_attachment) ⇒ Object



22
23
24
25
26
27
28
29
# File 'app/helpers/file_attachments_helper.rb', line 22

def file_container_data(file_attachment)
  return unless has_authorization?(:update, file_attachment)
   :span, file_attachment.file_container, {
    :id => "file_attachment_#{file_attachment.id}_file_container",
    :class => "file_attachment_file_container",
    :style => "display:none;"
  }
end

#name_display(file_attachment) ⇒ Object



13
14
15
16
17
18
19
20
# File 'app/helpers/file_attachments_helper.rb', line 13

def name_display(file_attachment)
   :p, {
    :id => "file_attachment_#{file_attachment.id}_name",
    :class => 'file_attachment_name'
  } do
    link_to_download_file_attachment(file_attachment)
  end
end