Module: Boxroom::FoldersHelper

Included in:
Boxroom::Folder::Cell::Show
Defined in:
app/helpers/boxroom/folders_helper.rb

Instance Method Summary collapse

Instance Method Details



3
4
5
6
7
# File 'app/helpers/boxroom/folders_helper.rb', line 3

def breadcrumbs(folder, breadcrumbs = '')
  breadcrumbs = "<li>#{link_to(folder.parent.name, folder.parent)}</li> #{breadcrumbs}"
  breadcrumbs = breadcrumbs(folder.parent, breadcrumbs) unless folder.parent == Folder.root
  breadcrumbs.html_safe
end

#file_icon(extension) ⇒ Object



9
10
11
12
13
14
15
# File 'app/helpers/boxroom/folders_helper.rb', line 9

def file_icon(extension)
  if extension && FileTest.exists?(Rails.root.join('app', 'assets', 'images', 'fileicons', "#{extension.downcase}.png"))
    "boxroom/fileicons/#{extension.downcase}.png"
  else
    'boxroom/file.png'
  end
end