I've taken over a slightly broken ember project, but I can't get even the most basic model to work. I've commented out all of the code of the former project, and have basically just this:
App = Ember.Application.create();
App.ApplicationAdapter = DS.FixtureAdapter.extend
App.Admin = DS.Model.extend(
userName: DS.attr("string")
roles: DS.attr("string")
)
App.Admin.FIXTURES = [
{
userName: 'Tester One'
roles: 'six-sided die'
}
{
userName: 'Tester Two'
roles: 'four-sided die'
}
]
App.Router.map ->
@route 'about', { path: '/about' }
@resource 'admins', { path: '/admins' }
App.AdminsRoute = Ember.Route.extend
model: ->
return @store.find('admin')
It's built inside of a Rails 4.0.1 app (running 0.14.1 of ember-rails and 1.3.2 of ember-source). When I go to the root page, I see the proper ember template. When I click on the link for about, I get routed to the about template. But when I click on admins or go to /admins, instead of having it render the admins template (which is just some static text), I get this error in my js console:
Error while loading route: TypeError: Object function () {
var Class = makeCtor(), proto;
Class.ClassMixin = Mixin.create(this.ClassMixin);
Class.PrototypeMixin = Mixin.create(this.PrototypeMixin);
Class.ClassMixin.ownerConstructor = Class;
Class.PrototypeMixin.o...<omitted>... } has no method 'create'
followed by a bunch of backtraces inside the ember code. I don't call create anywhere, and it was giving a similar error for the other models in the app that I've (since) commented out. I've tried to build this following the ember guide as something that would work for sure.
The Ember inspector sees an admins route named AdminsRoute using the AdminsController and admins template at /admins.
Simply put, I don't know how to debug this any further.
I've tried several versions of ember/-data, but currently I'm using 1.4.0-beta.6 and 1.0.0-beta.6 and getting this error still.
Thanks!
Error while loading route: TypeError: undefined is not a function. Try on Firefox and the error is different still:Error while loading route: instantiate@http://localhost:3000/etc.