From b298cea527f74f682d24defee360e0f45f47d125 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 6 May 2014 09:50:46 +0200 Subject: little bit of documentation --- app/controllers/errors_controller.rb | 5 +++-- config/application.rb | 1 + config/routes.rb | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index bf9329c..6c659e6 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,9 +1,10 @@ +# We render http errors ourselves so we can customize them class ErrorsController < ApplicationController - + # 404 def not_found end + # 500 def server_error end - end diff --git a/config/application.rb b/config/application.rb index 1077198..8555f48 100644 --- a/config/application.rb +++ b/config/application.rb @@ -92,6 +92,7 @@ module LeapWeb ## config.paths['app/views'].unshift "config/customization/views" + # handle http errors ourselves config.exceptions_app = self.routes end end diff --git a/config/routes.rb b/config/routes.rb index f92c704..9e0b72d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,6 +6,10 @@ LeapWeb::Application.routes.draw do root :to => "home#index" get '(:locale)' => 'home#index', :locale => MATCH_LOCALE, :as => 'home' + # + # HTTP Error Handling + # instead of the default error pages use the errors controller and views + # match '/404' => 'errors#not_found' match '/500' => 'errors#server_error' -- cgit v1.2.3