T
T
Toliam2015-12-04 22:18:39
Ruby on Rails
Toliam, 2015-12-04 22:18:39

Do you need a haml loop that first prints 3 jobs from everyone, then puts br, and then 4 and again br and repeats?

The haml loop in ruby ​​on rails, which first displays 3 jobs from everyone, then puts , and then 4 jobs and again the tag and repeats again, that is, 3 jobs and and 4 jobs and so many jobs.<br><br><br><br>

%section.section.interactive
  .list-hex-grid.large.clearfix
    - @works.each do |work|
      .hex.grid-4.invert.secondary
        = link_to show_works_path(work[:slug]), {:class=>"flex", :style=>"background-image:url(#{asset_path(work.image_small)})"} do
          .inner
            %i.fa.fa-eye.fa-4x.huge
            %h3.flex
              = work.name
          .hex-1
            %span.after
          .hex-2
            %span.after
          %span.after

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Toliam, 2015-12-05
@Toliam

Here is the code that works, in case anyone needs it)

%section.section.interactive
  .list-hex-grid.large.clearfix
    - @works.each_with_index do |work, index|
      .hex.grid-4.invert.secondary
        = link_to show_works_path(work[:slug]), {:class=>"flex", :style=>"background-image:url(#{asset_path(work.image_small)})"} do
          .inner
            %i.fa.fa-eye.fa-4x.huge
            %h3.flex
              = work.name
          .hex-1
            %span.after
          .hex-2
            %span.after
          %span.after
      - if (index%7 == 6) || (index%7 == 2)
        %br/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question