Module: Admin::PageAttachmentsHelper

Defined in:
app/helpers/admin/page_attachments_helper.rb

Instance Method Summary collapse

Instance Method Details

#preview_path(attachment) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'app/helpers/admin/page_attachments_helper.rb', line 2

def preview_path(attachment)
  case attachment.filename
  when /pdf$/
    attachment_path = '/images/admin/page_attachments/pdf-icon.png'
  else
    attachment_path = attachment.public_filename
  end
  attachment_path
end