2014-03-06 2 views
0

Embers가 서버 컨텍스트 루트에서 작동하게하려고하는데 다음을 시도 할 때 루트 컨텍스트 경로를 참조하려고 시도합니다. 불행히도 내가 할 때 store.find 그것을 액세스하려고 URL을 내 컨텍스트 루트를 포함하지 않습니다 수행합니까.EmberJS가 rootURL 지시문을 준수하지 않습니다.

나는 약간 다른 것들을 사용해 보았습니다. 많은 사람들이 컨텍스트 경로 내에서 행동해야하기 때문에 이것이 최전선이 아닐 것이라고 확신합니다. 사전에

감사, 에릭

window.Dashboard = Ember.Application.create({ 
    rootElement: '#ember-app', 
    LOG_TRANSITIONS: true 
}); 

Dashboard.Router.reopen({rootURL: "/dlmp/proteomics/"}); 

Models.registerModels(Dashboard); 

Dashboard.Router.map(function(){ 
    this.resource('completed'); 
    this.resource('ordered'); 
}); 

Dashboard.IndexRoute = Ember.Route.extend({ 
    redirect: function() { 
     // this redirects/to /dashboard 
     this.transitionTo('completed'); //TODO: load from local storage the users setting 
    } 
}); 

Dashboard.CompletedRoute = Ember.Route.extend({ 
    setupController: function(controller, sample) { 
     controller.set('model', sample); 
    }, 

    renderTemplate: function() { 
     this.render('orderTable'); 
    }, 

    model: function(params){ 
     return this.store.find('sample', {count: 25, orderBy: 'completeDate'}) 
    } 
}); 

Dashboard.OrderedRoute = Ember.Route.extend({ 
    setupController: function(controller, sample) { 
     controller.set('model', sample); 
    }, 

    renderTemplate: function() { 
     this.render('orderTable'); 
    }, 

    model: function(params){ 
     return this.store.find('sample', {count: 25, orderBy: 'orderDate'}) 
    } 
}); 

답변

0

나는 다음을 변경 할 수 있었다 작동하는 것 같다.

Dashboard.ApplicationAdapter = DS.RESTAdapter.extend({ 
    namespace: 'dlmp/proteomics/' 
}); 
관련 문제