I'm new to Emberjs and I'm developing Nodejs /Express/ app with MongoDB and Ember. According to this blog post I added primaryKey, serializerId to my extended adapter.
window.Frontend.Adapter = DS.RESTAdapter.extend({
namespace: 'api',
serializer: DS.RESTSerializer.extend({
serializeId: function(id) {
return id.toString();
},
primaryKey: function(type) {
return "_id";
}
})
});
window.Frontend.Store = DS.Store.extend({
adapter: 'window.Frontend.Adapter'
});
Everything is working perfect. But namespace not working for me. The request is sent to http://localhost:3000/pages not http://localhost:3000/api/pages. I don't have any idea.
Other resources for related issue:
- Ember, Ember Data and MongoDB's _id
- Adding New Ember.js Objects/Records when DB Provides ID
- Using primary keys with Ember Data
I'm using Ember 1.1.2 with Ember-Data 1.0.0.beta3. Thank you for any advice? If you need more info let me know :D
UPDATED If have similar issue go to this issue