fixes #2177
This commit is contained in:
@@ -35,10 +35,14 @@ class WikiPagesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
if params[:id] =~ /[a-zA-Z]/
|
if params[:id] =~ /\A\d+\Z/
|
||||||
@wiki_page = WikiPage.find_by_title(params[:id])
|
@wiki_page = WikiPage.find(params[:id])
|
||||||
else
|
else
|
||||||
@wiki_page = WikiPage.find_by_id(params[:id])
|
@wiki_page = WikiPage.find_by_title(params[:id])
|
||||||
|
if @wiki_page.nil?
|
||||||
|
redirect_to show_or_new_wiki_pages_path(:title => params[:id])
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
respond_with(@wiki_page)
|
respond_with(@wiki_page)
|
||||||
|
|||||||
Reference in New Issue
Block a user