Commit eae18d7b

mo khan <mo@mokhan.ca>
2013-06-16 16:28:57
stop rendering tag cloud with each tutorial and creation
1 parent 07c7f35
Changed files (2)
app
app/controllers/tags_controller.rb
@@ -1,7 +1,7 @@
 class TagsController < ApplicationController
   def show
     @tag = params[:id]
-    @tutorials = Tutorial.includes(:tags).tagged_with([@tag])
-    @creations = Creation.includes([:tags, :user]).tagged_with([@tag])
+    @tutorials = Tutorial.tagged_with([@tag])
+    @creations = Creation.includes(:user).tagged_with([@tag])
   end
 end
app/views/tags/show.html.erb
@@ -22,11 +22,6 @@
           <a href="<%= url_for tutorial %>"><img src="<%= tutorial.image_url %>" /></a>
           <div class="caption">
             <h3><a href="<%= tutorial.url %>" target="_blank"><%= tutorial.heading %></a></h3>
-            <p>
-            <% tutorial.tags.each do |tag| -%>
-              <a href="/tags/<%= tag.name %>"><span class="label"><%= tag.name %></span></a>
-            <% end -%>
-            </p>
             <p><%= tutorial.description %></p>
             <p><a class="btn" href="<%= url_for tutorial %>">View</a></p>
           </div>
@@ -39,11 +34,6 @@
           <a href="<%= url_for creation %>"><img src="<%= creation.primary_image.image.large.url %>" /></a>
           <div class="caption">
             <h3><a href="<%= url_for creation %>"><%= creation.name %></a> <em><small>by <a href="<%= url_for profile_path(creation.user) %>"> <%= shrink(creation.user.name, 20) %></a></small></em></h3>
-            <p>
-            <% creation.tags.each do |tag| -%>
-              <a href="/tags/<%= tag.name %>"><span class="label"><%= tag.name %></span></a>
-            <% end -%>
-            </p>
             <p><%= creation.story %></p>
             <p><a class="btn" href="<%= url_for creation %>">View</a></p>
           </div>