diff options
| -rw-r--r-- | app/controllers/tags_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 7433d21..c965443 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb | |||
| @@ -7,9 +7,12 @@ class TagsController < ApplicationController | |||
| 7 | 7 | ||
| 8 | def show | 8 | def show |
| 9 | @tag = Tag.find_by_name(params[:id]) | 9 | @tag = Tag.find_by_name(params[:id]) |
| 10 | |||
| 11 | tag_name = @tag ? @tag.name : nil | ||
| 12 | |||
| 10 | @page = Page.new | 13 | @page = Page.new |
| 11 | @pages = Page.heads.find_tagged_with( | 14 | @pages = Page.heads.find_tagged_with( |
| 12 | @tag.name, :order => 'published_at DESC' | 15 | tag_name, :order => 'published_at DESC' |
| 13 | ).paginate( | 16 | ).paginate( |
| 14 | :page=>params[:page], | 17 | :page=>params[:page], |
| 15 | :per_page => 23 | 18 | :per_page => 23 |
