]> projects.mako.cc - selectricity/commitdiff
Fix host truncation to work correctly
authorJohn Dong <jdong@mit.edu>
Fri, 31 Aug 2007 16:33:37 +0000 (12:33 -0400)
committerJohn Dong <jdong@mit.edu>
Fri, 31 Aug 2007 16:33:37 +0000 (12:33 -0400)
app/views/quickvote/list_voters.rhtml

index 4d8e5388aae7b0f674b1be991e5b5662788b0e05..cdfc049ae28808cbd5331e63d3f0383b2ba3fdcd 100644 (file)
@@ -38,7 +38,7 @@
             end
             
             %>
-        <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host[-30..-1])%>
+        <%=h((w.host == nil or w.host.empty?) ? voter.ipaddress : w.host.reverse.slice(0,30).reverse)%>
       </td>
       <td>
         <%org=(w.all.grep(/^(OrgName|org-name)/)[0] or "").sub(/^(OrgName|org-name)\:/,'').strip+" - "+ (w.all.grep(/^(NetName|netname)/)[0] or "").sub(/^(NetName|netname)\:/,'').strip %>

Benjamin Mako Hill || Want to submit a patch?