title: Jade Cannot read property 'length' of undefined in each loop
body: <p>I have this code in my controller retrieving an object from mongo and sending it to the client:</p>
  
  <pre><code> index: function(req, res){
      List.find({user:req.session.user.id}).exec(function foundLists(error, foundLists) {
          if(error) {
              return res.json({error:error});
          } else {
              return res.view({ title:'Lists',lists:foundLists });
          }
      });
   }
  </code></pre>
  
  <p>In my view I do the following:</p>
  
  <pre><code>extends ../layout
    block content
      .container
          p #{lists}
  </code></pre>
  
  <p>Which renders:<code>[object Object],[object Object]</code></p>
  
  <p>If I do <code>p= JSON.stringify(lists)</code></p>
  
  <p>It renders: </p>
  
  <pre><code>[{"user":"546109c0d640523d1b838a32","name":"third","createdAt":"2014-11-11T19:39:36.966Z","updatedAt":"2014-11-11T19:39:36.966Z","id":"546265f83e856b642e3b3fed"},{"user":"546109c0d640523d1b838a32","name":"forth","createdAt":"2014-11-11T19:42:09.268Z","updatedAt":"2014-11-11T19:42:09.268Z","id":"546266913e856b642e3b3fef"}]
  </code></pre>
  
  <p>I'm trying to achieve: </p>
  
  <pre><code>#lists
      each list in lists
         p #{list}
  </code></pre>
  
  <p>But I get this error:
  <code>Cannot read property 'length' of undefined</code></p>
  
  <p>I'm using Sails and Jade 1.7.0</p>