title: Add flash message to form without losing page
body: <p>I am using node.js and express to make a CRUD web app, and I am trying to work out how to get a flash message to appear on a data entry form when server side validation fails. I am using express-flash for the flash messages.</p>
  
  <p>The validation code works, returning errors, and I create the flash message:</p>
  
  <pre><code>var errors = validateForm(req);
  if(errors){
      req.flash('info',errors);
      res.render('edit', {messages: req.flash('info')}); 
  }
  </code></pre>
  
  <p>And display the message in the edit.jade file:</p>
  
  <pre><code>if messages.info
      p #{messages.info} 
  </code></pre>
  
  <p>The problem is that I am editing a specific object, and the url is not /edit, but /edit/objectID. The get for the page is like this:</p>
  
  <pre><code>router.get('/edit/:id', function(req, res) {
      var db = req.db;
      var collection = db.get('mydb');
      collection.find({ID: req.params.id},{},function(e,docs){
          res.render('edit', {"object" : docs});
      });
  });
  </code></pre>
  
  <p>Is it possible to add a flash message for server side validation after a POST has been sent without losing the page ID? I don't need all the data from the edit, there will be client side validation to hopefully pick up any errors, but I would like server side validation errors to cause the user to land on the same object page as they left.</p>