Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xuan Trung Le
venjob
Commits
64d312c3
Commit
64d312c3
authored
Nov 15, 2017
by
Xuan Trung Le
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update handling exception rails
parent
8d0f1d38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
app/controllers/application_controller.rb
+5
-0
public/404.html
+5
-2
No files found.
app/controllers/application_controller.rb
View file @
64d312c3
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :exception
helper_method
:clear_session_candidate
rescue_from
ActiveRecord
::
RecordNotFound
,
:with
=>
:error_not_found
def
clear_session_candidate
session
[
:candidate
]
=
{}
...
...
@@ -14,4 +15,8 @@ class ApplicationController < ActionController::Base
super
end
end
def
error_not_found
render
file:
'public/404.html'
end
end
public/404.html
View file @
64d312c3
...
...
@@ -54,14 +54,17 @@
</style>
</head>
<body
class=
"rails-default-error-page"
>
<body
class=
"rails-default-error-page
content
"
>
<!-- This file lives in public/404.html -->
<div
class=
"dialog"
>
<div>
<h1>
The page you were looking for doesn't exist.
</h1>
<p>
You may have mistyped the address or the page may have moved.
</p>
</div>
<p>
If you are the application owner check the logs for more information.
</p>
<p>
Go back to the previous page after 5s
</p>
</div>
</body>
<script
type=
"text/javascript"
>
setTimeout
(
function
(){
history
.
back
();},
5000
)
</script>
</html>
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