Last active
August 29, 2015 14:10
-
-
Save typeoneerror/e5ae6ee4dbde90587aee to your computer and use it in GitHub Desktop.
apiPathFor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import DS from 'ember-data'; | |
| export default DS.ActiveModelAdapter.extend({ | |
| host: 'http://customhost.dev', | |
| namespace: 'api/v1' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DS.Store.reopen({ | |
| apiPathFor: function() { | |
| var url = arguments.length ? Array.prototype.slice.call(arguments).join('/') : '' | |
| , adapter = this.adapterFor('application') | |
| return [adapter.urlPrefix(), url].join('/'); | |
| } | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use case inside a route (or object with access to DS.Store):