Permalink
Browse files

Fixed sort order in functions_group_by_alpha

  • Loading branch information...
1 parent 0aca14f commit 7d50f37413b42188b72f7dfe92149ce24841c695 @zk committed Oct 15, 2010
Showing with 4 additions and 4 deletions.
  1. +2 −2 app/helpers/application_helper.rb
  2. +2 −2 app/views/main/lib.html.erb
@@ -24,7 +24,7 @@ def group_into_ns(functions)
end
def functions_group_into_alpha(functions)
- functions.group_by do |f|
+ functions.sort{|a,b| a.name <=> b.name}.group_by do |f|
name = f.name
first_char = name[0,1].downcase
if first_char == "*"
@@ -34,7 +34,7 @@ def functions_group_into_alpha(functions)
else
first_char
end
- end
+ end.sort{|a,b| a[0] <=> b[0]}
end
def time_ago_or_time_stamp(from_time, to_time = Time.now, include_seconds = true, detail = false)
@@ -62,7 +62,7 @@
<% end %>
</div>
<div class="functions_list">
- <% group_into_ns(@library.namespaces.reduce([]) {|coll, ns| coll + ns.functions}).each do |g| %>
+ <% functions_group_into_alpha(@library.namespaces.reduce([]) {|coll, ns| coll + ns.functions}).each do |g| %>
<h5><%= g[0] %></h5>
<div class="functions">
<% g[1].each do |f| %>
@@ -76,4 +76,4 @@
<div class="grid_3">
&nbsp;
</div>
-</div>
+</div>

0 comments on commit 7d50f37

Please sign in to comment.