How to avoid duplicate entries in nested iteration?

So if your image is called image_name. Jpg you could have your thumbnail called thumbs/image_name. Jpg If your names are unconnected, then why not just associate them in your application so you use an associative array of images and thumbnail names?

My_images = "image_1. Jpg"=>"aflafffff_thumb. Jpg", "image_2.

Jpg"->"zofofroro_thumb. Jpg" Either of those ways enable you to just find the corresponding thumbnail for each image.

So if your image is called image_name. Jpg you could have your thumbnail called thumbs/image_name.jpg. If your names are unconnected, then why not just associate them in your application so you use an associative array of images and thumbnail names?

My_images = "image_1. Jpg"=>"aflafffff_thumb. Jpg", "image_2.

Jpg"->"zofofroro_thumb. Jpg" Either of those ways enable you to just find the corresponding thumbnail for each image.

Yeah, that was a good idea. Thanks, man – NARKOZ Sep 27 at 12:44.

You're looping through two collections (images and thumbs) - hence the duplicates. Guessing your image and thumb objects are linked somehow... e.g. Thumbs available doing something like image. Thumb images.

Each do |image| html Url) end By only iterating through the images collection you won't get duplicates.

The problem is that they're not linked. They are files in S3 with different prefixes and I'm using fog gem to retrieve them. – NARKOZ Sep 27 at 11:26.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions