Skip to content
This repository
Browse code

Merge pull request #43 from msherry/master

Pull request -- fix for numeric dashboard names
  • Loading branch information...
commit a2144e7bcda5237266c5b2ac14737836db0fa281 2 parents 323dcec + c31c4d7
R.I.Pienaar authored June 25, 2012
2  lib/gdash.rb
@@ -51,6 +51,6 @@ def dashboards
51 51
       end
52 52
     end
53 53
 
54  
-    dashboards.sort_by{|d| d[:name]}
  54
+    dashboards.sort_by{|d| d[:name].to_s}
55 55
   end
56 56
 end
2  views/index.erb
@@ -7,7 +7,7 @@
7 7
         <th width="70%">Description</th>
8 8
     </thead>
9 9
     <tbody>
10  
-        <% @top_level[key].dashboards.sort_by{|b| b[:name]}.each do |board| %>
  10
+        <% @top_level[key].dashboards.sort_by{|b| b[:name].to_s}.each do |board| %>
11 11
         <tr>
12 12
             <td><a href="<%= [@prefix, key, board[:link]].join('/') %>/"><%= board[:name] %></a></td><td><%= board[:description] %></td>
13 13
         </tr>
2  views/layout.erb
@@ -22,7 +22,7 @@
22 22
                             <li class="dropdown">
23 23
                                 <a href="#" class="dropdown-toggle"><%= category.capitalize %></a>
24 24
                                 <ul class="dropdown-menu">
25  
-                                <% @top_level[category].dashboards.sort_by{|b| b[:name]}.each do |board| %>
  25
+                                <% @top_level[category].dashboards.sort_by{|b| b[:name].to_s}.each do |board| %>
26 26
                                     <li><a href="<%= [@prefix, category, board[:link]].join('/') %>/"><%= board[:name] %></a></li>
27 27
                                 <% end %>
28 28
                                 </ul>

0 notes on commit a2144e7

Please sign in to comment.
Something went wrong with that request. Please try again.