Commit abba28d1

mo k <mo@mokhan.ca>
2013-01-28 04:34:00
add tags controller
1 parent 3bb883d
Changed files (2)
app
config
app/controllers/tags_controller.rb
@@ -0,0 +1,7 @@
+class TagsController < ApplicationController
+  # GET /tags/fondant
+  def show
+    @tag = params[:id]
+    @tutorials = Tutorial.tagged_with([@tag]).page(params[:page]).per(12)
+  end
+end
config/routes.rb
@@ -30,6 +30,9 @@ Cake::Application.routes.draw do
   match 'categories/:id' => 'categories#show', :method => 'GET'
   get 'categories/show'
 
+  # /tags
+  match 'tags/:id' => 'tags#show', :method => 'GET'
+
   # /search
   get "search/index"