A model layer for Rails and AngularJS