Browse files

Sorting resources url index alphabetically

  • Loading branch information...
1 parent 23d3de0 commit 1d4ce34c228212be2650e46cac82b360795ca43c Alexey Ilyichev committed Nov 13, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 templates/rest/layout/html/index.erb
View
6 templates/rest/layout/html/index.erb
@@ -42,11 +42,15 @@
<h2>Resources A-Z</h2>
<ul>
+ <% urls = [] %>
<% @objects.each do |object| %>
<% object.tags("url").each do |url_tag| %>
- <li><%= linkify(object, url_tag.text) %></li>
+ <% urls << [url_tag.text, object] %>
<% end %>
<% end %>
+ <% urls.sort_by(&:first).each do |elem| %>
+ <li><%= linkify(elem.last, elem.first) %></li>
+ <% end %>
</ul>
</div>

0 comments on commit 1d4ce34

Please sign in to comment.