Joindin 441: Redirecting the I'm attending button

Would someone be able to review my changes to Controller/Event.php, I'm not convinced that the way I'm doing the redirecting is the best way. If anyone can suggest something better that would be great.