Module: Atrium::ApplicationHelper

Defined in:
lib/atrium/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#get_essay_from_description(desc_hash, desc_id) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/atrium/application_helper.rb', line 15

def get_essay_from_description(desc_hash, desc_id)
  if !desc_hash.nil?
    return desc_hash[desc_id]
  else
    logger.error("hash is blank for some reason. Please check")
    return ""
  end
end

#is_editing?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/atrium/application_helper.rb', line 11

def is_editing?
  session[:edit_showcase].blank? ? false : true
end

#thumbnail_class(document) ⇒ Object



2
3
4
# File 'lib/atrium/application_helper.rb', line 2

def thumbnail_class( document )
  display_thumnail( document ) ? ' with-thumbnail' : ''
end

#top_level_showcase(exhibit_id) ⇒ Object



6
7
8
9
# File 'lib/atrium/application_helper.rb', line 6

def top_level_showcase(exhibit_id)
  showcases = Atrium::Showcase.find_by_atrium_exhibit_id(exhibit_id)
  showcase = showcases.first unless showcases.empty?
end