2012-09-16 07:44:54 -04:00
|
|
|
# Provides a base class for Admin controllers to subclass
|
|
|
|
#
|
|
|
|
# Automatically sets the layout and ensures an administrator is logged in
|
2013-01-20 06:20:50 -05:00
|
|
|
class Admin::ApplicationController < ApplicationController
|
2015-04-16 08:03:37 -04:00
|
|
|
before_action :authenticate_admin!
|
2015-05-01 04:39:11 -04:00
|
|
|
layout 'admin'
|
2012-09-16 07:44:54 -04:00
|
|
|
|
|
|
|
def authenticate_admin!
|
2017-04-08 22:20:57 -04:00
|
|
|
render_404 unless current_user.admin?
|
2015-10-28 11:39:23 -04:00
|
|
|
end
|
2012-09-16 07:44:54 -04:00
|
|
|
end
|