Commit 3f99ee63 authored by Holger Just's avatar Holger Just

Always display our custom 404 page

parent be4d679d
......@@ -65,6 +65,9 @@ class ApplicationController < ActionController::Base
filter_parameter_logging :password
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
# FIXME: This doesn't work with Rails >= 3.0 anymore
# Possible workaround: https://github.com/rails/rails/issues/671#issuecomment-1780159
rescue_from ActionController::RoutingError, :with => proc{render_404}
include Redmine::Search::Controller
include Redmine::MenuManager::MenuController
......
......@@ -436,8 +436,8 @@ module ApplicationHelper
css << 'theme-' + theme.name
end
css << 'controller-' + params[:controller]
css << 'action-' + params[:action]
css << 'controller-' + params[:controller] if params[:controller]
css << 'action-' + params[:action] if params[:action]
css.join(' ')
end
......
......@@ -49,4 +49,13 @@ class ApplicationTest < ActionController::IntegrationTest
assert_response 200
assert_nil session[:user_id]
end
def test_always_use_custom_404
get 'something_not_existing'
assert_response :not_found
assert_tag :tag => 'p',
:attributes => {:id => 'errorExplanation'},
:content => "The page you were trying to access doesn't exist or has been removed."
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment