put tags in alpha order, but put pdf first

This commit is contained in:
joshua stein 2012-07-11 14:46:04 -05:00
parent 82ae95f8ca
commit bd9d2aa3c4

View file

@ -28,7 +28,8 @@ class="story <%= story.vote == 1 ? "upvoted" : (story.vote == -1 ?
</span>
<% if story.can_be_seen_by_user?(@user) %>
<span class="tags">
<% story.taggings.each do |tagging| %>
<% story.taggings.sort_by{|t| t.tag.tag }.sort_by{|t|
t.tag.tag == "pdf" ? -1 : 0 }.each do |tagging| %>
<a href="<%= tag_url(tagging.tag.tag) %>" class="tag tag_<%=
tagging.tag.tag %>"><%= tagging.tag.tag %></a>
<% end %>