Class: ActiveAdmin::Dashboards::DashboardController

Inherits:
ResourceController show all
Defined in:
lib/active_admin/dashboards/dashboard_controller.rb

Constant Summary

Constants inherited from ResourceController

ResourceController::ACTIVE_ADMIN_ACTIONS

Instance Method Summary collapse

Methods inherited from ResourceController

#active_admin_application, #active_admin_config, #active_admin_template, #authenticate_active_admin_user, #create, #csv_filename, #current_active_admin_user, #current_active_admin_user?, #determine_active_admin_layout, #edit, #new, #only_render_implemented_actions, #renderer_for, #show, #update

Methods included from ResourceController::Scoping

#begin_of_association_chain, #method_for_association_chain

Methods included from ResourceController::PageConfigurations

#index_config, #show_config

Methods included from ResourceController::Form

#form_config

Methods included from ResourceController::Filters

#filters_config

Methods included from ResourceController::Collection::Pagination

#active_admin_collection, #paginate, #setup_pagination_for_csv

Methods included from ResourceController::Collection::Scoping

#active_admin_collection, #current_scope, #scope_collection

Methods included from ResourceController::Collection::Search

#active_admin_collection, #clean_search_params, #search

Methods included from ResourceController::Collection::Sorting

#active_admin_collection, #sort_order

Methods included from ResourceController::Collection::BaseCollection

#active_admin_collection, #collection, #scoped_collection

Instance Method Details

#current_menuObject (protected)

Return the current menu for the view. This is a helper method



32
33
34
# File 'lib/active_admin/dashboards/dashboard_controller.rb', line 32

def current_menu
  ActiveAdmin.application.namespaces[namespace].menu
end

#find_sectionsObject (protected)



18
19
20
# File 'lib/active_admin/dashboards/dashboard_controller.rb', line 18

def find_sections
  ActiveAdmin::Dashboards.sections_for_namespace(namespace)
end

#indexObject



7
8
9
10
# File 'lib/active_admin/dashboards/dashboard_controller.rb', line 7

def index
  @dashboard_sections = find_sections
  render 'active_admin/dashboard/index.html.arb'
end

#namespaceObject (protected)



22
23
24
25
26
27
28
29
# File 'lib/active_admin/dashboards/dashboard_controller.rb', line 22

def namespace
  class_name = self.class.name
  if class_name.include?('::')
    self.class.name.split('::').first.underscore.to_sym
  else
    :root
  end
end

#set_current_tabObject (protected)



14
15
16
# File 'lib/active_admin/dashboards/dashboard_controller.rb', line 14

def set_current_tab
  @current_tab = I18n.t("active_admin.dashboard")
end