diff options
| author | hukl <contact@smyck.org> | 2010-05-09 11:12:55 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2010-05-09 11:12:55 +0200 |
| commit | f637d999653989f9ddf240a233e88e65e1ff022f (patch) | |
| tree | 05dc1250c0605f595d8aec0a5d2612da587ed1b3 /app | |
| parent | fe3f911ebe00c2e9caab4e0290badd30b9c284da (diff) | |
fix for non existing tags
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/tags_controller.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index d235601..473dce4 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb | |||
| @@ -8,11 +8,12 @@ class TagsController < ApplicationController | |||
| 8 | def show | 8 | def show |
| 9 | @tag = Tag.find_by_name(params[:id]) | 9 | @tag = Tag.find_by_name(params[:id]) |
| 10 | 10 | ||
| 11 | tag_name = @tag ? @tag.name : nil | 11 | @tag = @tag ? @tag.name : params[:id] |
| 12 | 12 | ||
| 13 | @page = Page.new | 13 | @page = Page.new |
| 14 | |||
| 14 | @pages = Page.heads.paginate( | 15 | @pages = Page.heads.paginate( |
| 15 | Page.find_options_for_find_tagged_with(tag_name).merge( | 16 | Page.find_options_for_find_tagged_with(@tag).merge( |
| 16 | :order => 'published_at DESC', | 17 | :order => 'published_at DESC', |
| 17 | :page=>params[:page], | 18 | :page=>params[:page], |
| 18 | :per_page => 23 | 19 | :per_page => 23 |
