title: How to use a ternary operator to add a class to an HTML element in ejs
body: <p>I am new to using ejs. I have a menu and I want to highlight the current menu item.
  I have tried this:</p>
  
  <pre><code>&lt;li class=&lt;% currentMenu == 'dashboard' ? 'active' : ''%&gt;&gt;
      &lt;a href= '/dashboard'&gt;
         &lt;i class="material-icons"&gt;dashboard&lt;/i&gt;
         &lt;span&gt;Dashboard&lt;/span&gt;
      &lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>The value of the currentMenu is served by an express router as shown below:</p>
  
  <pre><code>app.get('/dashboard', function(req, res) {
    if (isAuthorised) {
      res.render('pages/index', {
        title: 'Welcome | MW Tracker',
        email, userName, role, menus,
        currentMenu: 'dashboard'
      })
    } else {
      res.render('pages/sign-in', {
        title: 'Sign In | MW Tracker'
      })
    }
  });
  </code></pre>
  
  <p>Please how am I suppose to add the class?</p>