app/controllers/application_controller.rb
# Filter users to root if not admin
Filter users to root if not admin
Filter users to root if not admin
def authenticate_admin
    if current_user.nil? || !current_user.admin?
      redirect_to root_url and return unless performed?
    else
      return true
    end
  end
def authenticate_admin if current_user . nil? || ! current_user . admin? redirect_to root_url and return unless performed? else return true end end
Filter users to root if not admin
Filter users to root if not admin