Search code examples
htmlrubyloopsslim-lang

Theres a way to loop on slim a html element?


I'd like to loop this on slim:

.row.vh14.sand_bg.relative
  .col-lg-6.col-lg-offset-3.fill_top_60px
    .trabajo.col-lg-4.test_img.vh5
    .trabajo.col-lg-4.test_img.vh5
    .trabajo.col-lg-4.test_img.vh5
    .trabajo.col-lg-4.test_img.vh5
    .trabajo.col-lg-4.test_img.vh5
    .trabajo.col-lg-4.test_img.vh5

but no one by one, something like less loops o similar way,just define the number of iteration neededa and voila.

something:

element x (5) = element element element element element


Solution

  • Have you tried something like

    - 5.times do
       .trabajo.col-lg-4.test_img.vh5
    

    ?