Search code examples
ember.jsember-dataember-rails

Adding item to ember-data store prevents application template from rendering


I have a following route definition in my ember-rails project. The file is /app/assets/javascripts/routes/applicationRoute.js.coffee and the code is as follows:

ChAdmin.ApplicationRoute = Ember.Route.extend (
   model: ()->
     store = @.get("store")
     store.push("tapahtuma",
       id: 1,
       nimi: "test1",
       paiva: "11.1.2012"
     )

)

This prevents the application template from rendering. Can anyone tell me why is that? I can see from embers inspector that the item has been pushed to store. If I do anything else except push items in the store the app template renders just fine.

There are no errors in javascript console and starting the app I get:

DEBUG: ------------------------------- ember.js?body=1:394
DEBUG: Ember.VERSION : 1.0.0 ember.js?body=1:394
DEBUG: Handlebars.VERSION : 1.0.0 ember.js?body=1:394
DEBUG: jQuery.VERSION : 1.10.2 ember.js?body=1:394
DEBUG: ------------------------------- ember.js?body=1:394
Ember Debugger Active

Any help would be much appreciated.


Solution

  • Problem was an old version of ember-data. I ran "rails generate ember:install --head" and now the application template renders correctly.