I had the same problem ( I had to sort my equipments by their name ) and i solved like this:
<% @equipments.sort.each do |name, quantity| %>
...
<% end %>
@equipments is a hash that I build on my model and return on my controller. If you call .sort it will sort the hash based on it's key value.