Skip to content

Commit

Permalink
Document BuildURLMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Amiel Martin committed Mar 4, 2015
1 parent ec187eb commit 486f768
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/ember-data/lib/adapters/build_url_mixin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
var get = Ember.get;

/**
WARNING: This interface is likely to change in order to accomodate https://github.com/emberjs/rfcs/pull/4
## Using BuildURLMixin
To use url building, include the mixin when extending an adapter, and call `buildURL` where needed.
The default behaviour is designed for RESTAdapter.
### Example
```javascript
export default DS.Adapter.extend(BuildURLMixin, {
find: function(store, type, id, record) {
var url = this.buildURL(type.typeKey, id, record);
return this.ajax(url, 'GET');
}
});
```
### Attributes
The `host` and `namespace` attributes will be used if defined, and are optional.
@class BuildURLMixin
@namespace DS
*/
export default Ember.Mixin.create({
/**
Builds a URL for a given type and optional ID.
Expand Down

0 comments on commit 486f768

Please sign in to comment.