title: Each loop Haml?
body: <p>I have this <code>each</code> loop: (haml) </p>
  
  <pre><code>- @deals.each do |a|
       .slide
          %a{:href =&gt; "#"}
           - a.attachments.each do |a|
             = image_tag(a.file.url, :height =&gt;"325px", :width =&gt;"650px" )
              .caption{:style =&gt; "bottom:0"} 
                = a.description
  </code></pre>
  
  <p>Because <code>@deals</code> is combined query of 3 tables (models) I use <code>polymorphic_path</code> to generate the links of the images.</p>
  
  <pre><code>- @deals.each do |a|
       .slide
          %a{:href =&gt; "#"}
           - a.attachments.each do |a|
             = image_tag(a.file.url, :height =&gt;"325px", :width =&gt;"650px" ), polymorphic_path(@region, @city, a)
              .caption{:style =&gt; "bottom:0"} 
                = a.description
  </code></pre>
  
  <p>But this generates <code>region_city_attachment_path</code> which is not correct. The first each loop <code>a</code> variable store the correct value, but how can I <code>reach</code> the first <code>a</code> variable in the second <code>each</code> loop?</p>