rails active resource analogy in angular.js