If you feel like it, you could make a function that determines the path (say, redirect_path(id)) that handles the disctinction between admin and supervisors. That way, you can eliminate two nested if statements