I am trying to set up a REST model and have a problem that completely hurts me: the generated API call seems to delete the first letter of the model and therefore cannot get the data (error 404 appears).
I start by creating a repository:
App.Store = DS.Store.extend({ revision: 11, adapter: DS.RESTAdapter.reopen({ namespace: 'api/admin' }) });
Then I install the model (called "dbx_tables" in the REST service:
App.dbxTable = DS.Model.extend({ name: "string", db_column: "string" });
Then there is a route:
App.DbxRoute = Ember.Route.extend({ model: function() { return App.dbxTable.find(); } });
I turned on conversion logging:
App = Ember.Application.create({ LOG_TRANSITIONS: true });
So when I launch the application, it goes to the "about" page first and then to the "dbx" view (I'm not sure why it says dbx.index and not just dbx ):
DEBUG: ------------------------------- ember-1.0.0-rc.1.js:339 DEBUG: Ember.VERSION : 1.0.0-rc.1 ember-1.0.0-rc.1.js:339 DEBUG: Handlebars.VERSION : 1.0.0-rc.3 ember-1.0.0-rc.1.js:339 DEBUG: jQuery.VERSION : 1.9.1 ember-1.0.0-rc.1.js:339 DEBUG: ------------------------------- ember-1.0.0-rc.1.js:339 Transitioned into 'about' ember-1.0.0-rc.1.js:339 Transitioned into 'dbx.index' ember-1.0.0-rc.1.js:339 GET http:
note the link to bx_tables in the API call. How to remove the leading "d"? I was also not sure why it pluralizes the call, although it can easily fit into the convention, so it really doesn’t care.
source share