title: EmberJS: Accessing child controller functionality in parent
body: <p>This may be more of a structure question but the heading is my current issue.</p>
  
  <p>I have the following basic app:</p>
  
  <pre><code>var App = Ember.Application.create();
  
  App.ApplicationAdapter = DS.FixtureAdapter.extend();
  
  App.Router.map(function () {
      this.resource('numbers', {
          path: '/'
      });
      this.resource('users');
  
  });
  
  App.UsersRoute = Ember.Route.extend({
      model: function (params) {
          return this.store.findAll('user');
      }
  });
  
  App.NumbersRoute = Ember.Route.extend({
      model: function (params) {
          return this.store.findAll('number');
      }
  });
  
  App.User = DS.Model.extend({
      name: DS.attr('string'),
      numbers: DS.hasMany('number', {
          async: true
      })
  });
  
  App.Number = DS.Model.extend({
      value: DS.attr('number'),
      user: DS.belongsTo('user')
  });
  
  
  App.NumbersController = Ember.ArrayController.extend({
      total: function () {
          var total = 0;
          this.forEach(function (number) {
              total += parseFloat(number.get('value'));
          });
          return total;
      }.property()
  });
  
  App.User.FIXTURES = [{
      id: 1,
      name: 'Bob',
      numbers: [100, 101]
  }, {
      id: 2,
      name: 'Fred',
      numbers: [102]
  }];
  
  App.Number.FIXTURES = [{
      id: 100,
      value: 25,
      user: 1
  }, {
      id: 101,
      value: 15,
      user: 1
  }, {
      id: 102,
      value: 60,
      user: 2
  }];
  </code></pre>
  
  <p>Working example with templates is here: <a href="http://jsfiddle.net/sweetrollAU/9DuR3/" rel="nofollow">http://jsfiddle.net/sweetrollAU/9DuR3/</a></p>
  
  <p>The example shows a relationship between users and numbers. The first page is a list of all numbers in the app, their related user and a total of all numbers. The Users link shows the same content but each user should show its own subtotal for the numbers it has.</p>
  
  <p>My question is basically, how can I access the NumbersController method 'total' in my UsersController? Should I be accessing this method or do I have the structure incorrect?</p>
  
  <p>Thanks</p>