+
+
diff --git a/config/application.rb b/config/application.rb
index 5fe9a48..40a9a44 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,13 +1,12 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
-Bundler.require(*Rails.groups(:assets => %w(development test)))
+Bundler.require(*Rails.groups(assets: %w(development test)))
module Ensl
class Application < Rails::Application
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
+ # Custom error pages
+ config.exceptions_app = self.routes
# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += Dir["#{config.root}/app/services/**/", "#{config.root}/app/models/concerns/"]
@@ -16,16 +15,12 @@ module Ensl
config.secret_token = ENV['APP_SECRET']
# Use cookies
- config.session_store :cookie_store, :key => '_ENSL_session_key', :expire_after => 30.days.to_i
+ config.session_store :cookie_store, key: '_ENSL_session_key', expire_after: 30.days.to_i
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
config.time_zone = 'Amsterdam'
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
-
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
diff --git a/config/routes.rb b/config/routes.rb
index 9f94d0a..806b92f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,4 +1,8 @@
Ensl::Application.routes.draw do
+ %w(403 404 422 500).each do |code|
+ get code, to: 'errors#show', code: code
+ end
+
root to: "articles#news_index"
resources :articles do
diff --git a/public/403.html b/public/403.html
deleted file mode 100644
index d0a1bab..0000000
--- a/public/403.html
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
- You are not allowed to access this resource (403)
-
-
-
-
-
-
-
You are not allowed to visit the page you were looking for.
-
The administrator of this web site has denied access to you at this time.
-
HTTP 403 Forbidden
-
-
-
diff --git a/public/404.html b/public/404.html
deleted file mode 100644
index eff660b..0000000
--- a/public/404.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- The page you were looking for doesn't exist (404)
-
-
-
-
-
-
-
The page you were looking for doesn't exist.
-
You may have mistyped the address or the page may have moved.
-
-
-
\ No newline at end of file
diff --git a/public/422.html b/public/422.html
deleted file mode 100644
index b54e4a3..0000000
--- a/public/422.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
- The change you wanted was rejected (422)
-
-
-
-
-
-
-
The change you wanted was rejected.
-
Maybe you tried to change something you didn't have access to.
-
-
-
\ No newline at end of file
diff --git a/public/500.html b/public/500.html
deleted file mode 100644
index 0cd07c1..0000000
--- a/public/500.html
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
- We're sorry, but something went wrong (500)
-
-
-
-
-
-
-
We're sorry, but something went wrong.
-
We've been notified about this issue and we'll take a look at it shortly.
-
(If you're the administrator of this website, then please read
- the log file "<%=h RAILS_ENV %>.log"
- to find out what went wrong.)