Fixed problems when deleting redirected pages.
This commit is contained in:
parent
6eba04d30d
commit
65e41efc18
1 changed files with 5 additions and 2 deletions
|
@ -26,8 +26,11 @@ class PagesController < ApplicationController
|
|||
if @page.nil?
|
||||
redirect_to new_page_path(:title => params[:permalink])
|
||||
elsif @page.redirect?
|
||||
page = Page.find_by_id(@page.redirect)
|
||||
unless page.nil?
|
||||
flash[:notice] = "Weitergeleitet von #{@page.title} ..."
|
||||
redirect_to wiki_page_path(Page.find(@page.redirect).permalink)
|
||||
redirect_to wiki_page_path(page.permalink)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue