Commit 6242207c

mo khan <mo@mokhan.ca>
2013-06-21 18:34:17
load all cakes right off the category
1 parent b323210
Changed files (1)
app/controllers/categories_controller.rb
@@ -1,11 +1,6 @@
 class CategoriesController < ApplicationController
-  # GET /categories/fondant
   def show
     @category = Category.find_by_slug(params[:id])
-    if @category
-      @creations = Creation.includes(:user).joins(:categories).where(:categories => {:slug => params[:id]}).page(params[:page]).per(12)
-    else
-      redirect_to "/tags/#{params[:id]}"
-    end
+    @creations = @category.creations.includes(:user).page(params[:page]).per(12)
   end
 end