Sha256: 8a5a33a461915105c17c9dce02efeba56dfb3db9401b5d9eaa1038da4c450013

Contents?: true

Size: 368 Bytes

Versions: 6

Compression:

Stored size: 368 Bytes

Contents

module Worthwhile::GenericFileHelper

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

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
worthwhile-0.1.2 app/helpers/worthwhile/generic_file_helper.rb
worthwhile-0.1.1 app/helpers/worthwhile/generic_file_helper.rb
worthwhile-0.1.0 app/helpers/worthwhile/generic_file_helper.rb
worthwhile-0.0.3 app/helpers/worthwhile/generic_file_helper.rb
worthwhile-0.0.2 app/helpers/worthwhile/generic_file_helper.rb
worthwhile-0.0.1 app/helpers/worthwhile/generic_file_helper.rb