Haml's little-known list_of helper
TIL that given an Enumerable object and a block, the list_of method will iterate and yield the results of the block into sequential <li> elements.
= list_of [1, 2, 3] do |item|
The list_of method also optionally takes a hash of options applied to the output li tags as attributes.
Interested in more information like this? You can download my book The Rails 4 Way at Leanpub today. Final print edition on Addison Wesley coming early next year.