title: SailsJs res.render vs res.view
body: <p>I'm trying to use SailsJs to make a simple authentication web app with PassportJs + EJS template engine. </p>
  
  <p>This is my code in the AuthenController.coffee</p>
  
  <pre><code>processSignin: (req, res) -&gt;
    passport.authenticate('local', (err, user, info) -&gt;
      if err or not user
        return res.view('auth/signin', message:'failed')
      req.logIn user, (err) -&gt;
        return res.view('auth/signin', message:'failed') if err
        res.redirect '/'
    ) req, res
    return
  </code></pre>
  
  <p>If I use: <code>res.render('/auth/login', { message:'err' })</code> </p>
  
  <p>the browser <strong>only</strong> return HTML code of the login.ejs</p>
  
  <p>If I use: <code>res.view('/auth/login', { message:'err' })</code> 
  then it return login.ejs code <strong>wrapped in the layout.ejs's &lt;%-body%></strong></p>
  
  <p>Any explanation for this different? Is it a new feature of Sails or built-in of Express? Where I can find documents about this?</p>