2014-09-02 18:07:02 +05:30
|
|
|
# Provides a base class for Admin controllers to subclass
|
|
|
|
#
|
|
|
|
# Automatically sets the layout and ensures an administrator is logged in
|
|
|
|
class Admin::ApplicationController < ApplicationController
|
2015-09-11 14:41:01 +05:30
|
|
|
before_action :authenticate_admin!
|
2014-09-02 18:07:02 +05:30
|
|
|
layout 'admin'
|
|
|
|
|
|
|
|
def authenticate_admin!
|
2016-06-02 11:05:42 +05:30
|
|
|
render_404 unless current_user.is_admin?
|
2015-11-26 14:37:03 +05:30
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|