getting results of custom action in rails with angularjs -


I am using 3.2 rail with angular, and I understand how to use angular resources.

Resource (Do not Get It, Save, Query, Remove, and Delete) to return results from non-default action

Then I have in my mail controller def home @recent_posts = Post. Format.html format.json end end

and then in my JS file I have

  app.factory "post", ["$ resource", ($ Resource) - & gt; $ HOMECtrl = ["$ scope", "$" ("/ post /: id /: action", {id: "@id"}, {home: {method: "GET", isArray: true}}) ", ($ Scope, post) - & gt; $ Scope.recent_posts = Post.home ()]   

If I try and ng-repeat =" recent_posts Post ", you have forgotten to specify the verb {/ code> parameter:

  app.factory "post", ["$ resource", ($ resource) - & gt;    $ Resource "/ post /: id /: action", id: "@id", home: method: "received" parameter: verb: "home" is alright: 

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -