Fixed problems when deleting redirected pages.

This commit is contained in:
Benjamin Meichsner 2009-09-28 17:18:09 +02:00
parent 6eba04d30d
commit 65e41efc18

View file

@ -26,8 +26,11 @@ class PagesController < ApplicationController
if @page.nil?
redirect_to new_page_path(:title => params[:permalink])
elsif @page.redirect?
flash[:notice] = "Weitergeleitet von #{@page.title} ..."
redirect_to wiki_page_path(Page.find(@page.redirect).permalink)
page = Page.find_by_id(@page.redirect)
unless page.nil?
flash[:notice] = "Weitergeleitet von #{@page.title} ..."
redirect_to wiki_page_path(page.permalink)
end
end
end