App.Router.map(function () {
  this.resource('projects', {path: '/'}, function() {
    this.resource('project', {path: 'projects/:project_id'}, function() {
      this.resource('investigations', function() {
        this.resource('investigation', {path: '/:investigation_id'});  
      });
    });    
  });
});

App.Router.reopen({
  rootURL: '/portal'
});

App.ApplicationRoute = Ember.Route.extend({
  model: function () {
    return this.store.find('user').then(function(result){
      return result.get('firstObject');
    });
  },
  afterModel: function(user, transition) {
    user.get('projects');
    this.transitionTo('project');
  }
})

App.ProjectsRoute = Ember.Route.extend({
  model: function () {
    return this.store.all('project');
  },
  afterModel: function(projects, transition) {
    this.transitionTo('project', projects.objectAt(0));
  },
  renderTemplate: function() {
    this.render('projects', { 
      outlet: 'off-canvas' 
    });
  }
});

App.ProjectRoute = Ember.Route.extend({
  model: function(params) {
    return this.store.find('project', params.project_id);    
  },
  afterModel: function(project, transition) {
    project.get('investigations');
  },
  renderTemplate: function() {
    this.render('investigationsList', {
      outlet: 'main'
    });
    this.render({
      outlet: 'title'
    });
  }
});
@@ -791,24 +791,60 @@
 ansition) %7B%0A
+    if(!Ember.isEmpty(projects))%7B%0A  
     this.tra
@@ -886,16 +886,24 @@
 tAt(0));
+  %0A    %7D
 %0A  %7D,%0A  

Check if we have any projects