diff options
| author | hukl <contact@smyck.org> | 2009-11-02 22:19:20 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-11-02 22:19:20 +0100 |
| commit | bebbe35c5b0c26d1d8f75fa98f239e41f2aee054 (patch) | |
| tree | f03e1332ab5a8aa373a8587e2a22de40e20cb298 /app | |
| parent | 8acb9467ea656fe2ba8836fa64bd6bca36314977 (diff) | |
prevent tags internal server error
Diffstat (limited to 'app')
| -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 |
