Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed sort order in functions_group_by_alpha

  • Loading branch information...
commit 7d50f37413b42188b72f7dfe92149ce24841c695 1 parent 0aca14f
@zk authored
View
4 app/helpers/application_helper.rb
@@ -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)
View
4 app/views/main/lib.html.erb
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.