{"action":"closed","issue":{"url":"https://api.github.com/repos/mgonto/restangular/issues/779","labels_url":"https://api.github.com/repos/mgonto/restangular/issues/779/labels{/name}","comments_url":"https://api.github.com/repos/mgonto/restangular/issues/779/comments","events_url":"https://api.github.com/repos/mgonto/restangular/issues/779/events","html_url":"https://github.com/mgonto/restangular/issues/779","id":37371405,"number":779,"title":"POST to undefined path","user":{"login":"arg20","id":804281,"avatar_url":"https://avatars.githubusercontent.com/u/804281?v=3","gravatar_id":"","url":"https://api.github.com/users/arg20","html_url":"https://github.com/arg20","followers_url":"https://api.github.com/users/arg20/followers","following_url":"https://api.github.com/users/arg20/following{/other_user}","gists_url":"https://api.github.com/users/arg20/gists{/gist_id}","starred_url":"https://api.github.com/users/arg20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arg20/subscriptions","organizations_url":"https://api.github.com/users/arg20/orgs","repos_url":"https://api.github.com/users/arg20/repos","events_url":"https://api.github.com/users/arg20/events{/privacy}","received_events_url":"https://api.github.com/users/arg20/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mgonto/restangular/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mgonto/restangular/milestones/2","labels_url":"https://api.github.com/repos/mgonto/restangular/milestones/2/labels","id":745658,"number":2,"title":"1.5.0","description":"","creator":{"login":"pauldijou","id":1275293,"avatar_url":"https://avatars.githubusercontent.com/u/1275293?v=3","gravatar_id":"","url":"https://api.github.com/users/pauldijou","html_url":"https://github.com/pauldijou","followers_url":"https://api.github.com/users/pauldijou/followers","following_url":"https://api.github.com/users/pauldijou/following{/other_user}","gists_url":"https://api.github.com/users/pauldijou/gists{/gist_id}","starred_url":"https://api.github.com/users/pauldijou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauldijou/subscriptions","organizations_url":"https://api.github.com/users/pauldijou/orgs","repos_url":"https://api.github.com/users/pauldijou/repos","events_url":"https://api.github.com/users/pauldijou/events{/privacy}","received_events_url":"https://api.github.com/users/pauldijou/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":7,"state":"open","created_at":"2014-08-07T00:05:59Z","updated_at":"2015-02-21T14:27:37Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2014-07-08T13:49:53Z","updated_at":"2015-02-21T14:27:37Z","closed_at":"2015-02-21T14:27:37Z","body":"In order to take advantage of the extended restangular model I have a code looking like this:\r\n\r\n```javascript\r\n$scope.things = Restangular.all('things').getList().$object;\r\n\r\n$scope.newThing = Restangular.one('things');\r\n\r\n$scope.saveThing = function () {\r\n  $scope.newThing.save().then( function(createdThing) {\r\n     $scope.things.push(createdThing)\r\n  });\r\n}\r\n```\r\n\r\nWhat I do there is once creation is successful, I add the `newThing` to the `things` array that I fetched upon controller creation, so I avoid asking for all things again to refresh the list. So far so good, the problem arises when I wish to edit this newly added thing:\r\n\r\n```javascript\r\n$scope.saveChanges = function(thing) {\r\n  thing.save().then(function(){\r\n    console.log('Thing saved');\r\n  })\r\n}\r\n```\r\n\r\nif i wish to update the newThing that I just posted to the server, the http method now should be `PUT`, and it is, but to the url: \r\n\r\n`http://localhost:8080/api/things/undefined/the-id-of-the-thing`\r\n\r\nI am guessing that this is because the `save()` method returns a subresource of Thing (and i created the thing doing `Restangular.one('things')` without passing an id ), but this is a bit unexpected in my case. All I want to do is create a Thing, then post it, then once I get the Thing back from the server with its id, update it without restangular adding that undefined in the middle.\r\n"}}