Module: Calagator::TagsHelper

Defined in:
app/helpers/calagator/tags_helper.rb

Defined Under Namespace

Classes: TagIcon, TagLink

Instance Method Summary collapse

Instance Method Details

#display_tag_icons(event) ⇒ Object



37
38
39
40
41
42
# File 'app/helpers/calagator/tags_helper.rb', line 37

def display_tag_icons(event)
  event.tag_list.map do |tag_name|
    icon = TagIcon.new(tag_name, self)
    link_to(icon.image_tag, tag_events_path(tag_name)) if icon.exists?
  end.join(' ').html_safe
end


4
5
6
7
8
# File 'app/helpers/calagator/tags_helper.rb', line 4

def tag_links_for(model)
  model.tags.sort_by(&:name).map do |tag|
    TagLink.new(model.class.table_name, tag, self).render
  end.join(', ').html_safe
end