Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jade engine : set value from variable inside attribute

I'm beginner in Jade Engine and can't set value inside attribute. So, I have a similar code:

  for job in jobs
   tr
    td
     a(href="/job/= job.ID")= job.Title

= job.Title displays correctly, but I can't set job.ID. I need link with href like /job/12345, where 12345 is job.ID. How to do it?

like image 619
Oleg Sh Avatar asked Dec 01 '22 20:12

Oleg Sh


2 Answers

should be a(href="/job/#{job.ID}")

like image 83
Oleg Sh Avatar answered Dec 10 '22 11:12

Oleg Sh


This will work:

a(href="/job/" + job.ID)
like image 30
matthewtole Avatar answered Dec 10 '22 13:12

matthewtole