Home > Enterprise >  How to nest a div within another div from a for loop using slim
How to nest a div within another div from a for loop using slim

Time:02-26

I have the following code

div class = "content"
- for x in list
  -if x == "test"
    div id = "two"

I would expect div id = "two to be nested within div https://github.com/slim-template/slim" rel="nofollow noreferrer">the docs...

Indentation matters, but the indentation depth can be chosen as you like. If you want to first indent 2 spaces, then 5 spaces, it's your choice. To nest markup you only need to indent by one space, the rest is gravy.

div class = "content"
  - for x in list
    -if x == "test"
      div id = "two"
  • Related