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? if @page.nil?
redirect_to new_page_path(:title => params[:permalink]) redirect_to new_page_path(:title => params[:permalink])
elsif @page.redirect? elsif @page.redirect?
flash[:notice] = "Weitergeleitet von #{@page.title} ..." page = Page.find_by_id(@page.redirect)
redirect_to wiki_page_path(Page.find(@page.redirect).permalink) unless page.nil?
flash[:notice] = "Weitergeleitet von #{@page.title} ..."
redirect_to wiki_page_path(page.permalink)
end
end end
end end