class AdminController < ApplicationController
  before_action :validate_admin_user!

  private

  def validate_admin_user!
    redirect_to root_path unless current_user.admin?
  end
end

class AdminController < ApplicationController
  before_action :validate_admin_user!

  private

  def validate_admin_user!
    redirect_to root_path unless user_signed_in? && current_user.admin?
  end
end

Add user_signed_in? check to AdminController
Add user_signed_in? check to AdminController
