Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
62282ba5
Commit
62282ba5
authored
Oct 13, 2020
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy profile route under - scope
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
c5fa7c4e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
changelogs/unreleased/dz-scope-profile-routes.yml
changelogs/unreleased/dz-scope-profile-routes.yml
+5
-0
config/routes.rb
config/routes.rb
+8
-0
spec/routing/routing_spec.rb
spec/routing/routing_spec.rb
+4
-0
No files found.
changelogs/unreleased/dz-scope-profile-routes.yml
0 → 100644
View file @
62282ba5
---
title
:
Copy profile route under - scope
merge_request
:
45045
author
:
type
:
other
config/routes.rb
View file @
62282ba5
...
...
@@ -274,6 +274,14 @@ Rails.application.routes.draw do
draw
:snippets
end
# Serve profile routes under /-/ scope.
# To ensure an old unscoped routing is used for the UI we need to
# add prefix 'as' to the scope routing and place it below original routing.
# Issue https://gitlab.com/gitlab-org/gitlab/-/issues/210024
scope
'-'
,
as: :scoped
do
draw
:profile
end
root
to:
"root#index"
get
'*unmatched_route'
,
to:
'application#route_not_found'
...
...
spec/routing/routing_spec.rb
View file @
62282ba5
...
...
@@ -133,6 +133,10 @@ RSpec.describe ProfilesController, "routing" do
it
"to #show"
do
expect
(
get
(
"/profile"
)).
to
route_to
(
'profiles#show'
)
end
it
'to #show from scope routing'
do
expect
(
get
(
"/-/profile"
)).
to
route_to
(
'profiles#show'
)
end
end
# profile_preferences GET /profile/preferences(.:format) profiles/preferences#show
...
...
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