Module: Decidim::UserProfileHelper

Included in:
ProfileCell
Defined in:
decidim-core/app/helpers/decidim/user_profile_helper.rb

Overview

Helpers used in controllers implementing the ‘Decidim::UserProfile` concern.

Instance Method Summary collapse

Instance Method Details

#user_profile_tab(text, link, options = {}) ⇒ Object

Public: Shows a menu tab with a section. It highlights automatically bye detecting if the current path is a subset of the provided route.

text - The text to show in the tab. link - The path to link to. options - Extra options.

aria_link_type - :inclusive or :exact, depending on the type of
                 highlighting desired.

Returns a String with the menu tab.



16
17
18
19
20
21
22
# File 'decidim-core/app/helpers/decidim/user_profile_helper.rb', line 16

def (text, link, options = {})
  active = is_active_link?(link, (options[:aria_link_type] || :inclusive))

  (:li, class: "tabs-title#{active ? " is-active" : nil}") do
    link_to(text, link, options)
  end
end