Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

variable in class name jade

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

like image 625
user1860758 Avatar asked Dec 02 '12 11:12

user1860758


2 Answers

Try this (have not tested):

div(class="flag_#{ session.locale }") session.locale
like image 144
karaxuna Avatar answered Nov 16 '22 05:11

karaxuna


As for [email protected] works this way:

div(class="flag_" + session.locale) session.locale
like image 16
Pablo Armentano Avatar answered Nov 16 '22 07:11

Pablo Armentano