title: EJS variable reference from Express showing as undefined
body: <p>Following a <a href="https://stackoverflow.com/a/26245214/4115525">lot of great help from user Jobsamuel</a> I have been having some difficulty getting the data I am trying to get from an API call to appear in the browser:</p>
  
  <pre><code>// An express route.
  app.get('/activities', function (req, res) {
     if (req.user !== null) {
  
        // User is authenticated.
        getUserActivities(req.user.id, res);
      } else {
  
        // Redirect to login the user isn't authenticated.
        res.redirect('/login');
      }
  });
  
  
  // This function will make API calls to Fitbit
  // using the User ID we got from the PassportJS
  // authentication process.
  function getUserActivities(id, res) {
  
  // It will request from Fitbit User activities.
  request('https://api.fitbit.com/1/user/'+ id +'/activities/',
       function (error, response, body) {
          if (!error &amp;&amp; response.statusCode == 200) {
  
              // If everything goes well.
  
              return res.send(body);
          } else {
  
              // If something wrong happens.
              return res.send(error);
          }
        }
  );
  
  }
  </code></pre>
  
  <p>I want to show <code>body</code> on a webpage using EJS, which I have tried like this: <code>&lt;%= this.body %&gt;</code>. The page renders in the browser, but the variable shows as <code>undefined</code>. What am I doing wrong here? I assume this is just a syntax issue, but I feel as though I am missing a step.</p>
  
  <p>EDIT: Code where I call <code>res.render()</code>:</p>
  
  <pre><code>app.get('/', function(req, res){
    res.render('index', { user: req.user}, {body : body});
  });
  
  app.get('/account', ensureAuthenticated, function(req, res){
    res.render('account', { user: req.user });
  });
  
  app.get('/login', function(req, res){
    res.render('login', { user: req.user });
  });
  </code></pre>
  
  <p>EDIT 2: Relevant portion of <code>index.ejs</code></p>
  
  <pre><code>&lt;body&gt;
  &lt;% if (!user) { %&gt;
      &lt;h2&gt;Welcome! Please log in.&lt;/h2&gt;
  &lt;% } else { %&gt;
      &lt;!-- &lt;h2&gt;Hello, &lt;%= user.displayName %&gt;.&lt;/h2&gt; --&gt;
  &lt;div id="wrapper"&gt;
      &lt;div id="blank"&gt;&lt;/div&gt;
      &lt;div id="content"&gt;
        &lt;div id="info"&gt;
          Output: &lt;%= this.body %&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;% } %&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>UPDATE: The problem still persists. I feel like giving up on this. Something has to be missing here, right?</p>