You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Streaming responses might break this because you are likely calling `active_navigation_item` from your view and `active_navigation_item?` from your layout - this means you have to move setting your active navigation item to the controller
module ActiveNavigationItem
extend ActiveSupport::Concern
# Set if called with arguments
# otherwise get array
def active_navigation_item(*hierarchy)
if hierarchy.any?
@active_navigation_item = hierarchy.map(&:to_sym)
else
@active_navigation_item
end
end
# Get active navigation item state
def active_navigation_item?(*hierarchy)
@active_navigation_item[0...hierarchy.length] == hierarchy.map(&:to_sym) if @active_navigation_item