<%= @dir %> <% dirs = ['inbox','outbox','shared'] dirs.delete(@dir) dirs.each do |d| %>
<% end %>

<% @idx = 0 @threads.each do |object| @object = object %> <%= erb :object %> <% end %> <% unless @dir == 'shared' %>
<% end %>