<%# prefix index with leading zeroes to help alpha-numeric sorting. Note that index starts at 0 %> <% log = (@steps.count-1).to_s.length %> <% @steps.each_with_index do |step, index| %> <% name = [index.to_s.rjust(log, "0"), step[:name]].join(": ") %> :attr) %> time="<%= step[:time] %>"> <% if step[:error] %> :attr).gsub("\n", " ") %> /> <% end %> <% end %>