Railsアプリの上に構築され、Ember Dataを操作し、1つのエンティティタイプのみを表示、作成、サーバーに永続化する、非常にシンプルなEmberアプリを作成しました。最新のツール(Ember v1.0.0-pre.4-134-gaafb5eb)を備えたすべて。
しかし、私が遭遇した非常に奇妙な問題があります。私のアプリには、エンティティリスト(インデックス)と新しいエンティティを作成するためのフォームの2つのビューがあります。インデックスを直接入力すると、すべてOKと表示されます。しかし、他のビューに移動してからリストに戻ると、ビューは再度レンダリングされません。どこに問題があるのでしょうか?
新しいEmberルーターを使用していることが原因である可能性があります(おそらく正しくありません)。だから私はここにアプリの重要な部分を(私の観点から)貼り付けています:
ルーター:
App.Router.map(function() {
this.resource('bands', function() {
this.route('new');
});
});
App.IndexRoute = Ember.Route.extend({
redirect: function() {
this.transitionTo('bands');
}
});
App.BandsRoute = Ember.Route.extend({
model: function() {
return App.Band.find();
}
});
App.BandsNewRoute = Ember.Route.extend({
renderTemplate : function(){
this.render('bands_new',{
into:'application'
});
}
});
リストに戻るリンク-これは機能しません:
App.BandsNewController = Em.ArrayController.extend({
cancel: function() {
this.transitionTo('bands');
}
});
ここでアプリ全体を見てください:https
://github.com/pavelsmolka/roommating
(素晴らしいhttps://github.com/dgeb/ember_data_exampleに大きく影響を受けています)
信じられませんが、Ember自体のバグでしょうか?