gitlab-org--gitlab-foss/config/routes/snippets.rb
Stan Hu d6cd7006ae Fix broken Members link when relative URL root paths are used
Navigating to the "Members" section of a project would omit the
relative URL root path. Fix the redirection and eliminate the
need for a redirection in the first place.

Fix other redirections failing to work with relative roots
2017-10-27 14:32:38 -07:00

21 lines
513 B
Ruby

resources :snippets, concerns: :awardable do
member do
get :raw
post :mark_as_spam
end
collection do
post :preview_markdown
end
scope module: :snippets do
resources :notes, only: [:index, :create, :destroy, :update], concerns: :awardable, constraints: { id: /\d+/ } do
member do
delete :delete_attachment
end
end
end
end
get '/s/:username', to: redirect('u/%{username}/snippets'),
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }