gitlab-org--gitlab-foss/config/routes/snippets.rb
Sean McGivern c5dee301f8 Merge branch 'dm-snippet-download-button' into 'master'
Add download button to project snippets

See merge request !11004
2017-05-02 15:25:26 +00:00

18 lines
491 B
Ruby

resources :snippets, concerns: :awardable do
member do
get :raw
post :mark_as_spam
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)/ }