Permalink
Browse files

Added 404 for missing templates

  • Loading branch information...
1 parent 87162a5 commit 0435c84f32f72df67fca975d5e668a179ccde54b @robotex82 committed Feb 12, 2012
Showing with 9 additions and 5 deletions.
  1. +9 −5 app/controllers/ecm/page_controller.rb
@@ -11,11 +11,15 @@ def respond
@title = template.title
layout = template.layout unless template.layout.nil?
end
-
- if layout
- render :template => @page, :layout => template.layout
- else
- render :template => @page
+
+ begin
+ if layout
+ render :template => @page, :layout => template.layout
+ else
+ render :template => @page
+ end
+ rescue ActionView::MissingTemplate
+ raise ActionController::RoutingError.new('Not Found')
end
end
end

0 comments on commit 0435c84

Please sign in to comment.