I have a few custom AJAX requests that I use inside of some controllers and routes, for example:
var loginRoute = Ember.Route.extend({
actions: {
turns out you can access the Adapter from the store via this.store.adapterFor('application')
The new submitLogin
method could look like this:
submitLogin: function(user, pass) {
var data = { username: user, password: pass },
host = this.store.adapterFor('application').get('host'),
namespace = this.store.adapterFor('application').namespace,
postUrl = [ host, namespace, 'login' ].join('/'); // http://192.168.2.10/api/v1/login
Ember.$.post(postUrl, data).then();
}