27

I want to put Jade variable in tag attribute but it isn't evaluated.

a(href="/logout/#{user.name}")

teerapap
  • 5,303
  • 7
  • 33
  • 40

1 Answers1

53

You could use:

a(href='/logout/'+user.name)
Carlosedp
  • 1,951
  • 1
  • 17
  • 15
  • What if the variable is {{$obj->val}} (php blade template). Then anyway we must use brackets to avoid auto escaping but it will not be evaluated. – Alex Shwarc Mar 29 '16 at 20:11