diff options
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' |