app/controllers/application_controller.rb
def user_logout_required
    if logged_in?
      flash[:notice] = 'Please log out of your user account first!'
      redirect_to root_path
    end
  end
# Filter method - prevents users from logging in as admin
Filter method - prevents users from logging in as admin
Filter method - prevents users from logging in as admin
def user_logout_required
    if logged_in?
      flash[:notice] = 'Please log out of your user account first!'
      redirect_to root_path
    end
  end
def user_logout_required if logged_in? flash [ :notice ] = 'Please log out of your user account first!' redirect_to root_path end end
Filter method - prevents users from logging in as admin
Filter method - prevents users from logging in as admin