title: Controller and model data store access ember.js
body: <p>I'm currently using "ember-1.0.0-rc.7.js" to manage the persistence and data storage for my ember application.  </p>
  
  <p>user.js</p>
  
  <pre><code>App.User = DS.Model.extend({
      firstName:     DS.attr('string'),
      lastName:      DS.attr('string'),
      category:      DS.attr('string'),
      status:        DS.attr('string'),
      position:      DS.attr('string'),
      fullName:      function()
      {
         return '%@ %@'.fmt(this.get('firstName'), this.get('lastName'))
      }.property('firstName', 'lastName')
  });
  
  App.User.FIXTURES = 
  [
   {
     id:          1,
     firstName:   'Derek',
     lastName:    "H",
     category:    "admin",
     status:      "offline",
     position:    "3232"
   },
   {
     id:          2,
     firstName:   'Jim',
     lastName:    "H",
     category:    "admin",
     status:      "online",
     position:    "322"
   }
  ];
  </code></pre>
  
  <p>UserListController.js</p>
  
  <pre><code>App.UserListController = Ember.ArrayController.create({
      content: [],
      users: App.User.find()
  });
  </code></pre>
  
  <p>store.js</p>
  
  <pre><code>App.Store = DS.Store.extend({
    revision: 12,
    adapter: 'DS.FixtureAdapter'
  });
  </code></pre>
  
  <p>From the above, I assumed that App.User.find() would return me all the users.  However, I get the following error:</p>
  
  <p>Error From Firebug:</p>
  
  <pre><code>Your application does not have a 'Store' property defined. Attempts to call 'find' on model classes will fail. Please provide one as with 'YourAppName.Store = DS.Store.extend()'
  TypeError: store is undefined
  </code></pre>
  
  <p>The message doesn't make sense, but the store is defined for App.  If the store was not defined, then the below code would not work.</p>
  
  <p>In the below code, I call App.User.find() within the context of the route and it works.  </p>
  
  <p>router.js</p>
  
  <pre><code>Bib.Router.map(function () {
    this.resource('index', { path: '/' });
  });
  
  
  App.IndexRoute = Ember.Route.extend({
    model: function () {
      return ['a','b', 'c' ];
    },
    renderTemplate: function () {
          this.render();
          this.render('userList', { outlet: 'userList', into: 'application', controller: App.UserListController });//render the list in list outlet
    },
    setupController: function (controller, model) 
    {
       controller.set('menu', model);
       controller.set('test', App.User.find());
    }
  });
  </code></pre>
  
  <p>In the index.html</p>
  
  <pre><code>&lt;script type="text/x-handlebars" id="userList" data-template-name="userList"&gt;
     {{#each controller}}
         {{firstName}}
     {{/each}}
  &lt;/script&gt;
  </code></pre>
  
  <p>I want the contoller there to represent the UserListController and have it have a reference to the User Model.  Keep in mind I can't hook this up in the route since I only have one route for this application.</p>
  
  <p>I believe this is due to the context in which I'm making the call. In other words, using it within the Controller.I'm probably not understanding a fundamental concept how controllers and models are related. </p>
  
  <p>Any advice appreciated,
  Thanks,
  D</p>