app/controllers/application_controller.rb
def user_belongs_to_team!
    if signed_in? && current_team.present?
      redirect_to root_app_url unless current_team_role
    end
  end
# If there is a current team loaded ensure the signed in user
# is a member or else take them back to the root site
If there is a current team loaded ensure the signed in user
is a member or else take them back to the root site
If there is a current team loaded ensure the signed in user is a member or else take them back to the root site
def user_belongs_to_team!
    if signed_in? && current_team.present?
      redirect_to root_app_url unless current_team_role
    end
  end
def user_belongs_to_team! if signed_in? && current_team . present? redirect_to root_app_url unless current_team_role end end
If there is a current team loaded ensure the signed in user
is a member or else take them back to the root site
If there is a current team loaded ensure the signed in user is a member or else take them back to the root site