How does one add a conditional inside of a tag (link/anchor in my case) in jade?
Here's my pseudo code that of course won't work:
a(href="/foo", class="if (current_route[1] == 'foo'){active}") Go to Foo
How about
a(href="/foo", class=(current_route[1] === 'foo')? "active" : "") Go to Foo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With