title: rails extracting code from view to helper (content_tag misunderstanding?)
body: <p>I got the following code in my view:</p>
  
  <pre><code>&lt;ul class="thumbnails"&gt;
    &lt;% Photo.find_all_by_id(my_params, limit: 10).each do |p| %&gt;
      &lt;li class="thumbnail"&gt;
        &lt;%= image_tag(p.url(:fb)) %&gt;
      &lt;/li&gt;
    &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>It renders an unordered list with thumbnails. And it works okay - I see the list with images:</p>
  
  <pre><code>&lt;ul class="thumbnails"&gt;
    &lt;li class="thumbnail"&gt;
      &lt;img alt="bmw" src="/assets/.../bmw.jpg?1364218949"&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I would like to put it into helper, like this:</p>
  
  <pre><code>module PhotosHelper
    def photos_thumbs_by_ids(photos_ids)
      content_tag :ul, :class =&gt; "thumbnails" do
        Photo.find_all_by_id(photos_ids, limit: 10).each do |p|
          content_tag :li, :class =&gt; "thumbnail" do
            image_tag(p.url(:fb))
          end
        end
      end
    end
  end
  </code></pre>
  
  <p>But when I use <code>&lt;%= photos_thumbs_by_ids my_params %&gt;</code> in my view, it renders only:</p>
  
  <pre><code>&lt;ul class="thumbnails"&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>What am I doing wrong?</p>