highway/app/controllers/admin_controller.rb
2025-05-07 22:04:48 -04:00

19 lines
346 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