Question for my ruby script

Hi, below is the ruby script to show all the photos of a product.
Now I want to showing all the photos apart from the first one
it mean if got 5 photos for this product, it will show 2-5 photos, not
the first one.

<% product.images.each do |image| %>
<%= image_tag(image.image.url(‘120x90’, :jpg)) %>
<% end %>

I tried to change it to this:

<% product.images.each do |image[1]| %>
<%= image_tag(image.image.url(‘120x90’, :jpg)) %>
<% end %>

but doesn’t work, any one can advice please.

On Tue, Oct 22, 2013 at 1:56 PM, yinwen Xuan [email protected]
wrote:

product.images.each do |image|

product.images[1…-1].each do |image|

John W Higgins wrote in post #1125261:

On Tue, Oct 22, 2013 at 1:56 PM, yinwen Xuan [email protected]
wrote:

product.images.each do |image|

product.images[1…-1].each do |image|

Cool, it work great, Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs