Commit da107db9

mo k <mo@mokhan.ca>
2012-05-03 03:18:41
display the first 20 characters to prevent the overflow.
1 parent bebdb62
Changed files (2)
app/helpers/creations_helper.rb
@@ -1,7 +1,8 @@
 module CreationsHelper
   def short_name(creation, length)
     if( creation.name.length > length)
-      creation.name.split(//).first(length).join('') + '...'
+      #creation.name.split(//).first(length).join('') + '...'
+      creation.name[0...length] + '...'
     else
       creation.name
     end
app/views/shared/_creation_image_gallery.html.erb
@@ -3,7 +3,7 @@
     <li class="span3">
     <div class="thumbnail">
       <div class="caption">
-        <h5><a href="<%= url_for creation %>"><%= short_name(creation, 25) %></a></h5>
+        <h5><a href="<%= url_for creation %>"><%= short_name(creation, 20) %></a></h5>
         <h6><a href="<%= url_for profile_path(creation.user) %>"><%= creation.user.name %></a></h6>
         <a href="<%= url_for creation %>">
           <img src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>" width="260px" height="180px" />