goodeggs/angular-cached-resource — pull request #14 by demands (2014-05-14 07:56:44+00:00)
Title: Sending an array to a POST action

Credit for discovering this issue goes to @Danita with issue #12.
Using Angular's $resource module, you can do the following:

```javascript
var Groups = $resource('/groups/:id', { id: '@id' }, {
saveByContact: {
url: '/contacts/:contactId/groups/:id',
method: 'PUT'
}
});
Groups.saveByContact({contactId: 'C-3PO'}, [{id: 'rebel_alliance'}, {id: 'human_cyborg_relations'}]);
```

...and it will make a request against `/contacts/C-3PO/` with the
body: `[{id: 'rebel_alliance'}, {id: 'human_cyborg_relations'}]`.

But with $cachedResource, the similar:

```javascript
var Groups = $cachedresource('groups', '/groups/:id', { id: '@id' }, {
saveByContact: {
url: '/contacts/:contactId/groups/:id',
method: 'PUT'
}
});
Groups.saveByContact({contactId: 'C-3PO'}, [{id: 'rebel_alliance'}, {id: 'human_cyborg_relations'}]);
```

...will make a request against `/contacts/C-3PO/` with the
body: `{0: {id: 'rebel_alliance'}, 1: {id: 'human_cyborg_relations'}}`.

It's a subtle difference but it should be fixed.