<% notes.each do |label, per_file| %> <% per_file.each do |file, line_notes| %> <% line_notes.sort!{ |a,b| a[0] <=> b[0] } %> <% line_notes.each do |line, note| %> <%= h note %> <% end %> <% end %> <% end %>