如何在一些数据之后进行迭代?

How to iterate after some data?

我有一个带有 has_many 图片模型的产品模型

所以在第一个循环中我只得到前 4 张图像

 <%  @product.images.first(4).each do |i| %>
    <li>
      <a href="<%= i.photo.url.to_s %>">
        <%= image_tag(i.photo.url(:small).to_s, :class => 'thumbnail circle', :'data-zoom-href' => i.photo.url(:big).to_s) %>
      </a>
    </li>
       <% end %>

如何循环前4张图片后的剩余图片?

我试过了:没有成功!

 <ul>


  <%  @product.images.last.each do |i| %>
    <li>
      <a href="<%= i.photo.url.to_s %>">
        <%= image_tag(i.photo.url(:small).to_s, :class => 'thumbnail circle', :'data-zoom-href' => i.photo.url(:big).to_s) %>
      </a>
    </li>
       <% end %>


  </ul>

使用offset:

@product.images.offset(4).each { }

offset(4)表示前4条之后的所有记录。