我有以下路线:
Redb.Router.map ()->
@resource "forms", ->
@route "new"
@route "show", path: "/:form_id"
我有关联的模板和控制器。
使用link-to
帮助程序生成的链接,一切正常,但是,例如当我#/forms/1
并回到#/forms
时,它会出现以下错误:
Assertion failed: The initializer 'store' has already been registered
Assertion failed: The initializer 'dataAdapter' has already been registered
Assertion failed: The initializer 'injectStore' has already been registered
然后,当我按下前进按钮时,我得到:
Error while loading route: TypeError: Cannot set property 'store' of undefined
at DS.Store.Ember.Object.extend.modelFor (http://localhost:3000/assets/ember-data.js?body=1:2726:19)
at DS.Store.Ember.Object.extend.find (http://localhost:3000/assets/ember-data.js?body=1:1730:17)
at Ember.Route.Ember.Object.extend.findModel (http://localhost:3000/assets/ember.js?body=1:34817:23)
at Ember.Route.Ember.Object.extend.model (http://localhost:3000/assets/ember.js?body=1:34806:17)
at getModel (http://localhost:3000/assets/ember.js?body=1:33269:45)
at model (http://localhost:3000/assets/ember.js?body=1:33197:17)
at invokeCallback (http://localhost:3000/assets/ember.js?body=1:9428:19)
at publish (http://localhost:3000/assets/ember.js?body=1:9098:9)
at Promise.publishFulfillment (http://localhost:3000/assets/ember.js?body=1:9518:7)
at Object.DeferredActionQueues.flush (http://localhost:3000/assets/ember.js?body=1:5651:24)
Error while loading route: TypeError: Cannot set property 'store' of undefined
at DS.Store.Ember.Object.extend.modelFor (http://localhost:3000/assets/ember-data.js?body=1:2726:19)
at DS.Store.Ember.Object.extend.find (http://localhost:3000/assets/ember-data.js?body=1:1730:17)
at Ember.Route.Ember.Object.extend.findModel (http://localhost:3000/assets/ember.js?body=1:34817:23)
at Ember.Route.Ember.Object.extend.model (http://localhost:3000/assets/ember.js?body=1:34806:17)
at getModel (http://localhost:3000/assets/ember.js?body=1:33269:45)
at model (http://localhost:3000/assets/ember.js?body=1:33197:17)
at invokeCallback (http://localhost:3000/assets/ember.js?body=1:9428:19)
at publish (http://localhost:3000/assets/ember.js?body=1:9098:9)
at Promise.publishFulfillment (http://localhost:3000/assets/ember.js?body=1:9518:7)
我是Ember的新手,我正在努力学习它。任何人都可以帮我这个吗?
答案 0 :(得分:3)
如上所述[{3}},问题出在turbolinks
,当点击后退和前进按钮时,turbolinks
会导致奇怪的效果。
删除turbolinks
可以解决问题。