Permalink
Browse files

Redirect to edit if page doesn't exist

  • Loading branch information...
1 parent 78bd641 commit 557d8e18b51aae447ffa99e1bec6d4b6b43befa8 @Vanuan Vanuan committed Jul 8, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 app/controllers/gollum_controller.rb
@@ -44,10 +44,12 @@ def project_repository_path
end
def show_page(name)
- @page_name = name
if page = @wiki.page(name)
+ @page_name = page.name
@page_title = page.title
@page_content = page.formatted_data.html_safe
+ else
+ redirect_to :action => :edit, :id => name
end
end

0 comments on commit 557d8e1

Please sign in to comment.