diff options
| author | mo k <mo@mokhan.ca> | 2012-09-20 06:48:39 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-09-20 06:48:39 -0600 |
| commit | 543ab218e14eeced7c7060610480459579935957 (patch) | |
| tree | 2a02efa4cfc7a3c5241e50b9d908005fe7b1013d /app/controllers/tutorials_controller.rb | |
| parent | b5f3f4d72689892f290ac1f3eb5fbdab34391928 (diff) | |
filter tutorials by tag.
Diffstat (limited to 'app/controllers/tutorials_controller.rb')
| -rw-r--r-- | app/controllers/tutorials_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb index bcf5cdd6..a47ad899 100644 --- a/app/controllers/tutorials_controller.rb +++ b/app/controllers/tutorials_controller.rb @@ -2,7 +2,11 @@ class TutorialsController < ApplicationController before_filter :authenticate_user!, :except => [:show, :index] def index - @tutorials = Tutorial.all.reverse + if params[:tags] + @tutorials = Tutorial.tagged_with([params[:tags]]) + else + @tutorials = Tutorial.all.reverse + end end def show |
