variable in class name jade

user1860758 picture user1860758 · Dec 2, 2012 · Viewed 20.7k times · Source

I can't set a variable name in a class in jade:

.flag_#{ session.locale } #{ session.locale }

I have:

<div class="flag_" >en</div>

And I'd like to have

<div class="flag_en" >en</div>

Thanks

Answer

karaxuna picture karaxuna · Dec 2, 2012

Try this (have not tested):

div(class="flag_#{ session.locale }") session.locale