2016-10-05 11:43:47 -04:00
|
|
|
resources :snippets, concerns: :awardable do
|
|
|
|
member do
|
2017-04-30 13:15:20 -04:00
|
|
|
get :raw
|
2017-02-01 13:15:59 -05:00
|
|
|
post :mark_as_spam
|
2017-05-03 11:26:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
collection do
|
2017-04-20 04:56:41 -04:00
|
|
|
post :preview_markdown
|
2016-10-05 11:43:47 -04:00
|
|
|
end
|
2017-04-27 06:41:26 -04:00
|
|
|
|
|
|
|
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
|
2016-10-05 11:43:47 -04:00
|
|
|
end
|
|
|
|
|
2017-10-25 14:15:35 -04:00
|
|
|
get '/s/:username', to: redirect('u/%{username}/snippets'),
|
2016-10-05 11:43:47 -04:00
|
|
|
constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }
|