Module: Worthwhile::GenericFileHelper

Included in:
MainAppHelpers
Defined in:
app/helpers/worthwhile/generic_file_helper.rb

Instance Method Summary collapse

Instance Method Details



7
8
9
# File 'app/helpers/worthwhile/generic_file_helper.rb', line 7

def generic_file_link_name(gf)
  can?(:read, gf) ? gf.filename : "File"
end

#generic_file_title(gf) ⇒ Object



3
4
5
# File 'app/helpers/worthwhile/generic_file_helper.rb', line 3

def generic_file_title(gf)
  can?(:read, gf) ? gf.to_s : "File"
end

#parent_path(parent) ⇒ Object



11
12
13
14
15
16
17
# File 'app/helpers/worthwhile/generic_file_helper.rb', line 11

def parent_path(parent)
  if parent.is_a?(Collection)
    collection_path(parent)
  else
    polymorphic_path([:curation_concern, parent])
  end
end