Class: MenuLinkPresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
app/presenters/menu_link_presenter.rb

Instance Method Summary collapse

Instance Method Details

#badgeObject



15
16
17
18
19
# File 'app/presenters/menu_link_presenter.rb', line 15

def badge
  return "" if no_badge?

  (:span, link.badge, class: 'badge')
end

#certification_badgeObject



21
22
23
24
25
# File 'app/presenters/menu_link_presenter.rb', line 21

def certification_badge
 return "" if no_certification_badge?

  (:span, (:i, '', class: "cert-status #{link.certification_badge}") + " #{link.certification_badge.titleize}", class: 'badge label-icon')
end

#css_classObject



27
28
29
# File 'app/presenters/menu_link_presenter.rb', line 27

def css_class
  "active" if selected?
end


7
8
9
10
11
12
13
# File 'app/presenters/menu_link_presenter.rb', line 7

def featured_tag(name)
  if featured?
    (:em, name.html_safe)
  else
    name.html_safe
  end
end