Module: Decidim::MenuHelper

Defined in:
app/helpers/decidim/menu_helper.rb

Overview

This module includes helpers to manage menus in layout

Instance Method Summary collapse

Instance Method Details

Public: Returns the main menu presenter object



7
8
9
10
11
12
13
14
15
# File 'app/helpers/decidim/menu_helper.rb', line 7

def main_menu
  @main_menu ||= ::Decidim::MenuPresenter.new(
    :menu,
    self,
    element_class: "main-nav__link",
    active_class: "main-nav__link--active",
    label: t("layouts.decidim.header.main_menu")
  )
end

#user_menuObject

Public: Returns the user menu presenter object



18
19
20
21
22
23
24
25
26
# File 'app/helpers/decidim/menu_helper.rb', line 18

def user_menu
  @user_menu ||= ::Decidim::InlineMenuPresenter.new(
    :user_menu,
    self,
    element_class: "tabs-title",
    active_class: "is-active",
    label: t("layouts.decidim.user_menu.title")
  )
end