mirror of
https://github.com/System-End/highway.git
synced 2026-04-19 18:35:18 +00:00
18 lines
345 B
Ruby
18 lines
345 B
Ruby
class AdminController < ApplicationController
|
|
before_action :require_authentication
|
|
before_action :authenticate_user
|
|
|
|
def dashboard
|
|
@users = User.all
|
|
@posts = Post.all
|
|
@projects = Project.all
|
|
end
|
|
|
|
private
|
|
|
|
def authenticate_user
|
|
unless current_user && current_user.admin?
|
|
redirect_to root_path
|
|
end
|
|
end
|
|
end
|