Permalink
Browse files

Truncate long links to, lets say, 64 chars

  • Loading branch information...
1 parent 8ed4fa5 commit f61ea29bdd4cf6eb4b7ed95eb60559f03caed5f2 @davidjrice davidjrice committed Sep 16, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/views/links/_link.html.erb
View
2 app/views/links/_link.html.erb
@@ -1,6 +1,6 @@
<tr>
<td class="short-url"><%= link_to short_url(link.key), short_url(link.key) %></td>
- <td class="long-url"><%= link_to(link.url, link.url) %></td>
+ <td class="long-url"><%= link_to(truncate(link.url, :length => 64), link.url) %></td>
<td class="num-views"><span><%= link.views %></span></td>
<td class="time-since"><%= distance_of_time_in_words link.created_at, Time.zone.now %></td>
</tr>

0 comments on commit f61ea29

Please sign in to comment.