> How about you change your code to
> 
> <% @dilemmas.each do |dilemma| %>
>     <% dilemma.dilemma_sides.each do |dilemma_side| %>
> 
>       <% side_image = dilemma_side.side_images.first %>
>       <% if !side_image %>
>         Side <%= dilemma_side.id %> has no images
>       <% end %>
>     <%end%>
> <% end %>
> 
> and see what it outputs.
> 
> Fred

Hey,

I've tried it, and as expected, it does not go into the loop.  I am sure 
that it is finding the Side Image belonging to the Dilemma Side.  For 
some strange reason, when I loop through the array which contains the 
Side Images:

 <% dilemma_side.side_images.each do |side_image|%>
  <%= side_image.filename.to_s  %>
        <%end>

Then Rails allows me to access the attribute directly.  I'm certainly 
doing something wrong with instance variables assignments/declarations.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to