spine/spine — pull request #465 by adambiggs (2013-04-24 23:10:49+00:00)
Title: Proposal - Ajax support for relation.coffee

Looking to get some feedback on this idea before writing tests & cleaning it up.

The goal is to properly scope Ajax URLs when using `Collection.create()` (#461), and provide a `Collection.fetch()` method that matches the `Model.fetch()` API:

```coffee
Picture.hasMany 'comments', Comment

Picture.first().comments().fetch()
# GET => `/pictures/123/comments`

Picture.first().comments().create()
# POST => `/pictures/123/comments`
```

The proposed changes also allow overriding ajax URLs in the `options` object for other `Spine.Model` methods:

```coffee
Picture.first().updateAttribute 'title', 'lorem ipsum', { url: '/some/other/url' }
# PUT => `/some/other/url`
```