Array to HTL list helper
<%= list(@posts) { |post| link_to post.title, posts_url(post) } %>
And the actual helper (put it in application_helper.rb):
1 2 def list(stuff, &block) 3 content_tag(:ul, stuff.map { |thingie| content_tag(:li, yield(thingie)) }) 4 end