snippets.rb 513 Bytes
Newer Older
1 2
resources :snippets, concerns: :awardable do
  member do
3
    get :raw
4
    post :mark_as_spam
5 6 7
  end

  collection do
8
    post :preview_markdown
9
  end
10 11 12 13 14 15 16 17

  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
18 19
end

20
get '/s/:username', to: redirect('u/%{username}/snippets'),
21
                    constraints: { username: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }