class Kadmin::Configuration

Attributes

handle_errors[RW]

@return [Boolean] if true, any Kadmin::ApplicationController will catch errors and display a custom page

logger[RW]

@return [Logger] An instance of a Ruby compatible logger

mount_path[RW]

@return [String] the path the engine is mounted at (used for authentication routes)

navbar_items[RW]

@return [Array<Kadmin::Navbar::Section, Kadmin::Navbar::Link>] list of admin links or sections

Public Class Methods

new() click to toggle source
# File lib/kadmin/configuration.rb, line 17
def initialize
  @mount_path = '/admin'
  @logger = Rails.logger
  @navbar_items = []
  @handle_errors = false
end

Public Instance Methods

add_navbar_items(*items) click to toggle source
# File lib/kadmin/configuration.rb, line 24
def add_navbar_items(*items)
  items.each do |item|
    index = @navbar_items.bsearch_index { |navbar_item| navbar_item.text >= item.text }
    @navbar_items.insert(index || @navbar_items.size, item)
  end
end
navbar_items_for_user(user) click to toggle source

filter available nav sections with the user's accept string