EmberJS不尊重rootURL指令

时间:2014-03-06 19:02:12

标签: ember.js

我试图让Embers与服务器上下文根一起工作,但是当我尝试以下操作时,我一直试图引用根上下文路径。不幸的是,当我执行store.find时,它尝试访问的url不包括我的上下文根。

我尝试了一些稍微不同的东西但无济于事。我确信这不是一个边缘案例,因为许多人必须在上下文路径中行事。

提前感谢, 埃里克

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'})
    }
});

1 个答案:

答案 0 :(得分:0)

我能够改变以下内容,似乎有效。

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