highway/app/controllers/admin_controller.rb
2025-05-12 15:31:38 -04:00

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