summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-15 00:11:19 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-10-15 00:36:22 +0300
commit2b9a25bd5a69c3c6a5bb24bb67838a4d354204e1 (patch)
tree044c12f4bb1585096dd55f11007a1a0400462dee /config/routes.rb
parent5e9a394440f806302a34bb092e3b46d19430dccc (diff)
downloadgitlab-ce-2b9a25bd5a69c3c6a5bb24bb67838a4d354204e1.tar.gz
Handle unmatched routing with not_found method
We need this to prevent routing error when user access URL like /123 when there is no resource located under such name Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 83c3a42c19f..659ea51bc75 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -88,4 +88,6 @@ Rails.application.routes.draw do
get ':username.keys' => 'profiles/keys#get_keys', constraints: { username: /.*/ }
root to: "root#index"
+
+ get '*unmatched_route', to: 'application#not_found'
end