I want to add an attribute class="active" to an element when some condition (in C++) is true. I currently do it like this:
%a(href="/myurl" method="POST" class=(active ? "active" : ""))
Unfortunately, in this way the "class" attribute is always present, even when it's empty. This makes the resulting HTML code not very clean.