title: Redirect and render template with new variables
body: <p>I will show my code first in order to be clear.</p>
  
  <pre><code>router.get("/add", (req, res)=&gt;{
      res.render("user/add.ejs");
  });
  
  router.put("/add/pi", (req, res)=&gt;{
      if(condition){
          //do something
      }else{
          res.redirect("/user/add");
          //res.render("user/add.ejs", {error: "At least one field should be filled in order to submit the form", type: "form error","location": "form-container"});
      }
  });
  </code></pre>
  
  <p>Ejs:</p>
  
  <pre><code>&lt;% if(error){ %&gt;
      &lt;small id="personalinformationError" class="form-text text-danger"&gt;&lt;%= error %&gt;&lt;/small&gt;
  &lt;% }%&gt;
  </code></pre>
  
  <p>I want to be able to render the ejs template with the object in the <code>render()</code> in the comment. I tried to render it like in the comment without <code>redirect()</code> and it shows an error whenever I mention the variable name. The error goes like <code>variable is not defined</code>.</p>
  
  <p>Thank you in advance.</p>