0
votes

I'm building an ember application with a RESTAdapter to access my data in an api. I'm using the latest version of ember-data from https://github.com/emberjs/data/downloads.

This is how I'm declaring my RESTAdatpter-

App.ApplicationAdapter = DS.RESTAdapter.extend({
    host: 'http://example.com'
});

but I dont think it's declared correctly as the ember inspector in the browser says that it cannot detect an adapter. Where am I going wrong?

2
Any other code available? Do you see API calls in you console going to example.com or another address (e.g. localhost)? - claptimes
it's going to localhost! - bookthief
Can you post any other initialization code? - claptimes
Anything in particular? I dont have any other js which refer to the adapter/ server name. - bookthief
I think I had the same issue at the beginning and found an answer somewhere that worked. Try reopening the adapter using DS.RESTAdapter.reopen({ // same options as above }) - claptimes

2 Answers

1
votes

I had the same issue and was able to get it to work using the following:

DS.RESTAdapter.reopen({
  host: 'http://example.com'
})

I'm not sure if the guides need to be updated or if there's a different way to accomplish this.

0
votes

It worked when I changed the ember data version to 1.0.0-beta.