2014-03-06 36 views
0

我想让烬与一个服务器上下文根工作,但我一直试图引用根上下文路径,当我尝试以下。不幸的是,当我执行一个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/' 
});