following leanpub book https://leanpub.com/angularjs-rails