application_controller.rb 460 Bytes
Newer Older
1 2 3
# Provides a base class for Admin controllers to subclass
#
# Automatically sets the layout and ensures an administrator is logged in
4
class Admin::ApplicationController < ApplicationController
5
  before_action :authenticate_admin!
6
  before_action :set_title
7 8 9 10

  def authenticate_admin!
    return render_404 unless current_user.is_admin?
  end
11 12 13 14 15 16

  def set_title
    @title      = "Admin area"
    @title_url  = admin_root_path
    @sidebar    = "admin"
  end
17
end