Commit 5325d57b

mo k <m@mokhan.ca>
2012-02-10 02:41:39
add # of favorites below each creation image.
1 parent 030effa
Changed files (1)
app/views/shared/_creation_image_gallery.html.erb
@@ -1,7 +1,11 @@
 <h2>Recent Creations</h2>
 <ul class="media-grid">
   <% @creations.each do |creation| %>
-    <li><a href="<%= url_for creation %>"><img class="thumbnail" src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>"></a></li>
+    <% if( creation.favorites.count > 0)  %>
+      <li><a href="<%= url_for creation %>"><img class="thumbnail" src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>"><%= creation.favorites.count%></a></li>
+    <% else %>
+      <li><a href="<%= url_for creation %>"><img class="thumbnail" src="<%= creation.image.thumb.url %>" alt="<%= creation.name %>"></a></li>
+    <% end %>
   <% end %>
 </ul>