Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant put id to div from variable Jade

I have the following in my Jade view:

- var items = "one"
each item in items
  div(id= #{items})

what I want is:

<div id="one"></div>

but Jade renders:

<div id="undefinedoneundefined"></div>

this is driving me crazy, I'm using Jade with Express.js.

BTW I've asked something similar but less clear, hope not to annoy anyone with my silliness.

like image 683
omarloren Avatar asked Nov 13 '12 18:11

omarloren


1 Answers

Something like this?

- var items = ["one", "two", "three"]
each item in items
  div(id= item)
like image 69
David Weldon Avatar answered Sep 20 '22 11:09

David Weldon