Good afternoon, I'm trying to deploy the following. When the user select one image, this one is open in a modal window, but each image that is tiggered by the user opens the same picture. The first one. Here is the code: <div id='user-home-gallery' class='user-container' > <% cache ['photos', Photo.latest] do %> <% @photos.each do |photo| %> <% if @user_home.id == photo.user_id %> <% if photo.avatar_file_name == nil %> <%= image_tag 'missing.png', class:'img-gallery', id:'image'%> <% else %> <%= image_tag photo.avatar.url, class:'img-gallery', id:'img-click' , remote:true %> <div style='display:none' id='img-modal'> <%= image_tag photo.avatar.url, class:'img-gallery'%> <a href="#" class="close">Close</a> </div> <% end %> <% end %> <% end %> <% end %> </div> Could anyone tell me what I'm doing wrong?. Thanks & Best regards -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bc44ec46-08b0-4640-ba81-966e71019ef0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.