Commit 9db0346a
Changed files (2)
app
controllers
views
categories
app/controllers/categories_controller.rb
@@ -14,6 +14,7 @@ class CategoriesController < ApplicationController
# GET /categories/1.xml
def show
@category = Category.where(:slug => params[:id])
+ @creations = Creation.joins(:categories).where(:categories => {:slug => params[:id]}).page(params[:page]).per(6)
respond_to do |format|
format.html # show.html.erb
app/views/categories/show.html.erb
@@ -5,10 +5,11 @@
<%= @category.name %>
</p>
-<p>
- <b>Slug:</b>
- <%# <%= @category.slug %>
-</p>
+<ul>
+<% @creations.each do |creation| %>
+ <li><%= creation.name %>
+<% end %>
+</ul>
<%= link_to 'Edit', edit_category_path(@category) %> |