title: Loop & output content_tags within content_tag in helper
body: <p>I'm trying a helper method that will output a list of items, to be called like so:</p>
  
  <pre><code>foo_list( ['item_one', link_to( 'item_two', '#' ) ... ] )
  </code></pre>
  
  <p>I have written the helper like so after reading <a href="https://stackoverflow.com/questions/3561250/using-helpers-in-rails-3-to-output-html">Using helpers in rails 3 to output html</a>:</p>
  
  <pre><code>def foo_list items
      content_tag :ul do
          items.collect {|item| content_tag(:li, item)}
      end
  end
  </code></pre>
  
  <p>However I just get an empty UL in that case, if I do this as a test:</p>
  
  <pre><code>def foo_list items
      content_tag :ul do
          content_tag(:li, 'foo')
      end
  end
  </code></pre>
  
  <p>I get the UL &amp; LI as expected.</p>
  
  <p>I've tried swapping it around a bit doing:</p>
  
  <pre><code>def foo_list items
      contents = items.map {|item| content_tag(:li, item)}
      content_tag( :ul, contents )
  end
  </code></pre>
  
  <p>In that case I get the whole list but the LI tags are html escaped (even though the strings are HTML safe). Doing <code>content_tag(:ul, contents.join("\n").html_safe )</code> works but it feels wrong to me and I feel <code>content_tag</code> should work in block mode with a collection somehow.</p>