私は Ember-Rails を使用して、Beckend 用の Rails API を備えた Ember フロントエンド アプリを構築しています。私は認証の実装に取り組んでおり、次のエラーに到達しました:
Cannot read property 'extend' of undefined
次のようにルートを拡張しようとすると:
App.AdminRoute = App.AuthenticateRoute.extend({
model: function(params) {
return this.store.find('user', params.id);
},
});
そして、AuthenticateRoute を次のように定義しました。
App.AuthenticateRoute = Ember.Route.extend({
//yada yada
});
私は多かれ少なかれ以下にあるガイドに従っていました: http://www.embercasts.com/episodes/client-side-authentication-part-2
これが機能しない理由はわかりませんが、AuthenticateRouteが他のルートから拡張できることに気付きました。これは非常に奇妙です。