Displayin wrong modal image

Alfredo Barrero
Mon, 19 May 2014 15:07:09 -0000

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:


    <% 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

                <% end %>
            <% end %>

        <% end %>
    <% end %>



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.