Taken from http://www.honeybadger.io/blog/2013/12/11/beginners-guide-to-angular-js-rails