app/helpers/auth_helper.rb
# Require that a current user is authenticated and an administrator
Require that a current user is authenticated and an administrator
Require that a current user is authenticated and an administrator
def require_administrator
    store_location
    redirect_to signin_path, notice: 'You need to sign in!' && return unless logged_in?
    redirect_to root_url && return unless valid_administrator?
  end
def require_administrator store_location redirect_to signin_path , notice : 'You need to sign in!' && return unless logged_in? redirect_to root_url && return unless valid_administrator? end
Require that a current user is authenticated and an administrator
Require that a current user is authenticated and an administrator