title: Sails.js - passing data to a view
body: <p>I've recently started learning how to use Sails.js and I came across a small issue.</p>
  
  <p>I have a model called Applicant, as follows:</p>
  
  <pre><code>module.exports = {
  
    attributes: {     
       name: {
        type: 'STRING',
        required: true
       },
  
       email: {
        type: 'STRING',
        required: true
       }
  
    }
  
  };
  </code></pre>
  
  <p>I have built the index action to return all the instances of the Applicant model:</p>
  
  <pre><code>module.exports = {
      index: function(req, res) {
          Applicant.findAll().done(function(err, applicants) {
              res.view({
                  apps: applicants
              });
          });
      }
  };
  </code></pre>
  
  <p>And this is the view that I am using:</p>
  
  <pre><code>&lt;section id="applicants"&gt;
      &lt;h1&gt;List of applicants&lt;/h1&gt;
  
      &lt;ul&gt;
          &lt;% for (applicant in apps) { %&gt;
          &lt;li&gt;&lt;%= applicant.name %&gt; &lt;%= applicant.email %&gt;&lt;/li&gt;
          &lt;% } %&gt;
      &lt;/ul&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>Still, when I load the corresponding URL, I can't see my data displayed.</p>
  
  <p>I have read the Sails.js documentation, but I can't seem to find what's wrong with my code.</p>
  
  <p>It would be great if someone could help me solve this problem.</p>
  
  <p>Thank you!</p>