From the book Riding Rails with AngularJS