Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
3f99ee63
Commit
3f99ee63
authored
Jan 30, 2012
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always display our custom 404 page
parent
be4d679d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
application_controller.rb
app/controllers/application_controller.rb
+3
-0
application_helper.rb
app/helpers/application_helper.rb
+2
-2
application_test.rb
test/integration/application_test.rb
+9
-0
No files found.
app/controllers/application_controller.rb
View file @
3f99ee63
...
...
@@ -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
...
...
app/helpers/application_helper.rb
View file @
3f99ee63
...
...
@@ -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
...
...
test/integration/application_test.rb
View file @
3f99ee63
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment