Add an AdminController base class for Admin controllers
Handles stuff that's shared across admin controllers.
This commit is contained in:
parent
83f24de352
commit
925183ed7a
9 changed files with 27 additions and 44 deletions
11
app/controllers/admin_controller.rb
Normal file
11
app/controllers/admin_controller.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Provides a base class for Admin controllers to subclass
|
||||
#
|
||||
# Automatically sets the layout and ensures an administrator is logged in
|
||||
class AdminController < ApplicationController
|
||||
layout 'admin'
|
||||
before_filter :authenticate_admin!
|
||||
|
||||
def authenticate_admin!
|
||||
return render_404 unless current_user.is_admin?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue