2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
resources :snippets, except: [:create, :update, :destroy], concerns: :awardable, constraints: { id: /\d+/ } do
|
2016-11-03 12:29:30 +05:30
|
|
|
member do
|
2017-08-17 22:00:37 +05:30
|
|
|
get :raw
|
|
|
|
post :mark_as_spam
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
collection do
|
2017-08-17 22:00:37 +05:30
|
|
|
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
|
2016-11-03 12:29:30 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-10-24 23:57:45 +05:30
|
|
|
get '/snippets/:snippet_id/raw/:ref/*path',
|
|
|
|
to: 'snippets/blobs#raw',
|
|
|
|
as: :snippet_blob_raw,
|
|
|
|
format: false,
|
|
|
|
constraints: { snippet_id: /\d+/ }
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
get '/s/:username', to: redirect('users/%{username}/snippets'),
|
2016-11-03 12:29:30 +05:30
|
|
|
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
|