Module: VerticalNavHelper
- Defined in:
- app/helpers/vertical_nav_helper.rb
Instance Method Summary collapse
- #show_vertical_nav? ⇒ Boolean
-
#vertical_menu_for(navable) ⇒ Object
Generates the HTML code for a vertical menu, where the given navable object, e.g.
-
#vertical_nav ⇒ Object
Returns the html code for the vertical navigation, i.e.
Instance Method Details
#show_vertical_nav? ⇒ Boolean
25 26 27 |
# File 'app/helpers/vertical_nav_helper.rb', line 25 def show_vertical_nav? @navable.present? end |
#vertical_menu_for(navable) ⇒ Object
Generates the HTML code for a vertical menu, where the given navable object, e.g. a Page or a User, is the currently active element.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/helpers/vertical_nav_helper.rb', line 12 def (navable) if navable @ancestor_navables = cached_ancestor_navables(navable) @active_navable = navable @active_navables = [@active_navable] @child_navables = cached_child_navables(navable) (@ancestor_navables, :ancestor) + (@active_navable, :active) + (@child_navables, :child) end end |
#vertical_nav ⇒ Object
Returns the html code for the vertical navigation, i.e. the vertical menu.
5 6 7 |
# File 'app/helpers/vertical_nav_helper.rb', line 5 def vertical_nav render partial: 'layouts/vertical_nav' end |