ruby on rails - Make a PATCH or PUT request using $resource -


I am trying to create an update function in an angle controller:

  $ Scope .update = function (product) {product. $ Save (); $ Scope.cancelEdit (); }  

There are two ways to update a resource in my backend:

  PATCH /products/:id(.:format) PUT / products /: Id (.: Format)  

However, I can not access any of these using the $ resource ! , I can either use these functions to send requests with some tasks:

  {get}: {method: 'get'}, 'save': {method: POST '},' Query ': {method:' GET ', isArray: true},' remove ': {method:' DELETE '},' delete ': {method:' DELETE '}};  

So what does it mean to send me a patch or put request?

How should I configure my APP Central?

These are only the default, but you can define your own actions.

  $ resource (url, paramDefaults, {put: {method: 'PUT'}, patch: {method: 'PATCH'},});  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -