Module: ActiveAdmin::BaseController::Menu

Extended by:
ActiveSupport::Concern
Included in:
ActiveAdmin::BaseController
Defined in:
lib/active_admin/base_controller/menu.rb

Instance Method Summary collapse

Instance Method Details

#current_menuObject (protected)



14
15
16
# File 'lib/active_admin/base_controller/menu.rb', line 14

def current_menu
  active_admin_config.navigation_menu
end

#set_current_tabObject (protected)

Set’s @current_tab to be name of the tab to mark as current Get’s called through a before filter



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/active_admin/base_controller/menu.rb', line 20

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