{"id":1477,"date":"2022-08-30T15:16:51","date_gmt":"2022-08-30T15:16:51","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/23\/ember-attaching-a-restadaptor-error-on-ember-routeember325-error-while-loading-route-followed-by-massive-dump-of-javascript-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:51","modified_gmt":"2022-08-30T15:16:51","slug":"ember-attaching-a-restadaptor-error-on-ember-routeember325-error-while-loading-route-followed-by-massive-dump-of-javascript-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/ember-attaching-a-restadaptor-error-on-ember-routeember325-error-while-loading-route-followed-by-massive-dump-of-javascript-collection-of-common-programming-errors\/","title":{"rendered":"Ember attaching a RESTAdaptor: error on &lt;Ember.Route:ember325&gt; \/ Error while loading route followed by massive dump of JavaScript-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m new to Ember and getting this massive and somewhat cryptic error when moving from the Fixture Adaptor to the REST Adaptor. No other code changes were made other than commenting out my fixture data.<\/p>\n<p>my code:<\/p>\n<pre><code>App = Ember.Application.create();\n\n\/\/ App.ApplicationAdapter = DS.FixtureAdapter.extend();\n\nApp.ApplicationAdapter = DS.RESTAdapter.extend({\n  host: 'http:\/\/192.168.1.193:8080',\n  namespace: '\/serviceprovidersservice\/rest'\n});\n\nApp.Router.map(function() {\n  this.resource(\"service_providers\", function() {\n    this.route(\"new\");\n    this.route(\"edit\", { path: 'edit\/:id' });\n  });\n\n  this.resource(\"customers\", function() {\n    this.route(\"new\");\n    this.route(\"edit\", { path: 'edit\/:id' });\n  });\n});\n\n\/\/ Routes\n\nApp.ServiceProvidersIndexRoute = Ember.Route.extend({\n    model: function() {\n        return this.store.find('ServiceProvider');\n    }\n});\n\nApp.ServiceProvidersNewRoute = Ember.Route.extend({\n    model: function() {\n        return this.store.find('ServiceProvider');\n    }\n});\n\nApp.ServiceProvidersEditRoute = Ember.Route.extend({\n    model: function(params) {\n        return this.store.find('ServiceProvider', params.id);\n    }\n});\n\nApp.CustomersIndexRoute = Ember.Route.extend({\n    model: function() {\n        return this.store.find('Customer');\n    }\n});\n\nApp.CustomersEditRoute = Ember.Route.extend({\n    model: function(params) {\n        return this.store.find('Customer', params.id);\n    }\n});\n\nApp.CustomersNewRoute = Ember.Route.extend({\n    model : function() {\n        return {\n            serviceproviders : this.store.find('ServiceProvider')\n        };\n    }\n})\n\n\/\/ Controllers\n\nApp.ServiceProvidersNewController = Ember.ObjectController.extend({\n    actions : {\n        create: function() {\n            name = this.get(\"name\");\n            if (!name.trim()) { return; }\n            email = this.get(\"email\");\n\n            sp = this.store.createRecord('ServiceProvider', {\n                name: name,\n                email: email\n            });\n            sp.save();\n            this.set('name', '');\n            this.set('email', '');\n            this.transitionToRoute(\"service_providers.edit\", sp);\n        }\n    }\n});\n\nApp.ServiceProvidersEditController = Ember.ObjectController.extend({\n    isEditing: false,\n    actions: {\n        edit: function() {\n            this.set('isEditing', true);\n        },\n        doneEditing: function() {\n            this.set('isEditing', false);\n            this.get('model').save();\n        }\n    }\n});\n\nApp.CustomersEditController = Ember.ObjectController.extend({\n    isEditing: false,\n    actions: {\n        edit: function() {\n            this.set('isEditing', true);\n        },\n        doneEditing: function() {\n            this.set('isEditing', false);\n            this.get('model').save();\n        }\n    }\n});\n\nApp.CustomersNewController = Ember.ObjectController.extend({\n    selectedServiceProvider : null,\n    actions : {\n        create: function() {\n            firstname = this.get(\"firstname\");\n            lastname = this.get(\"lastname\");\n            if (!firstname.trim()) { return; }\n            email = this.get(\"email\");\n            serviceprovider = this.get(\"selectedServiceProvider\");\n            sp = this.store.createRecord('Customer', {\n                firstname: firstname,\n                lastname: lastname,\n                email: email,\n                serviceprovider: serviceprovider\n            });\n            sp.save();\n            this.set('name', '');\n            this.set('email', '');\n            this.transitionToRoute(\"customers.edit\", sp);\n        }\n    }\n});\n\n\/\/ Models\n\nApp.Customer = DS.Model.extend({\n    serviceprovider: DS.belongsTo('serviceProvider'),\n    firstname: DS.attr('string'),\n    lastname: DS.attr('string'),\n    email: DS.attr('string')\n});\n\nApp.ServiceProvider = DS.Model.extend({\n    name: DS.attr('string'),\n    email: DS.attr('string'),\n    customers: DS.hasMany('customer', {async:true})\n});\n<\/code><\/pre>\n<p>The errors:<\/p>\n<pre><code>[15:46:25.144] DEPRECATION: Action handlers contained in an `events` object are deprecated in favor of putting them in an `actions` object (error on )\n    trigger@file:\/\/\/home\/zen\/ember\/js\/libs\/ember-1.0.0.js:29641\n    handleError@file:\/\/\/home\/zen\/ember\/js\/libs\/ember-1.0.0.js:29903\n    invokeCallback@file:\/\/\/home\/zen\/ember\/js\/libs\/ember-1.0.0.js:8055\n    Promise.prototype.then\/<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-23 07:55:42. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m new to Ember and getting this massive and somewhat cryptic error when moving from the Fixture Adaptor to the REST Adaptor. No other code changes were made other than commenting out my fixture data. my code: App = Ember.Application.create(); \/\/ App.ApplicationAdapter = DS.FixtureAdapter.extend(); App.ApplicationAdapter = DS.RESTAdapter.extend({ host: &#8216;http:\/\/192.168.1.193:8080&#8217;, namespace: &#8216;\/serviceprovidersservice\/rest&#8217; }); App.Router.map(function() { this.resource(&#8220;service_providers&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1477","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1477"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1477\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}