Sha256: 2edc89cdc3da2bbf0043611456f269b666995e9ce80edac83894f1382a9c7389
Contents?: true
Size: 1 KB
Versions: 17
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true module ActiveAdmin class BaseController < ::InheritedResources::Base module Menu extend ActiveSupport::Concern included do before_action :set_current_tab helper_method :current_menu end protected def current_menu active_admin_config.navigation_menu end # Set's @current_tab to be name of the tab to mark as current # Get's called through a before filter def set_current_tab @current_tab = if current_menu && active_admin_config.belongs_to? && parent? parent_item = active_admin_config.belongs_to_config.target.menu_item if current_menu.include? parent_item parent_item else active_admin_config.menu_item end else active_admin_config.menu_item end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems