diff options
author | azul <azul@leap.se> | 2014-05-22 14:48:40 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2014-05-22 14:48:40 +0200 |
commit | 0c995deeb434237aa71e3a45f9f5a51f7c79116a (patch) | |
tree | d2988d37c9d3bdb02d9e0b36eb1bc61ca0782f1f /config | |
parent | b9174fdc9d9bd403d9a16650bafc4715e3dbf2d4 (diff) | |
parent | b298cea527f74f682d24defee360e0f45f47d125 (diff) |
Merge pull request #162 from azul/feature/3295-custom-error-pages
Feature/3295 custom error pages
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 3 | ||||
-rw-r--r-- | config/locales/en.yml | 9 | ||||
-rw-r--r-- | config/routes.rb | 7 |
3 files changed, 19 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb index 2c9c55a..8555f48 100644 --- a/config/application.rb +++ b/config/application.rb @@ -91,5 +91,8 @@ module LeapWeb ## see initializers/customization.rb ## config.paths['app/views'].unshift "config/customization/views" + + # handle http errors ourselves + config.exceptions_app = self.routes end end diff --git a/config/locales/en.yml b/config/locales/en.yml index cebf075..899d659 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,10 +1,19 @@ en: + home: Home privacy_policy: Privacy Policy terms_of_service: Terms of Service pricing: Pricing about: About Us contact: Contact + + not_found_title: Page not found. + not_found_subtitle: "The page you were looking for doesn't exist." + not_found_lead: "You may have mistyped the address or the page may have moved." + server_error_title: Ouch! + server_error_subtitle: We ran into a server error. + server_error_lead: The problem has been logged and we will look into it. no_such_thing: "No such %{thing}." + thing_was_successfully_created: "%{thing} was successfully created." create_thing: "Create %{thing}" diff --git a/config/routes.rb b/config/routes.rb index 745b97d..9e0b72d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,6 +6,13 @@ 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' + scope "(:locale)", :locale => MATCH_LOCALE, :controller => 'pages', :action => 'show' do get 'privacy-policy', :as => 'privacy_policy' get 'terms-of-service', :as => 'terms_of_service' |