-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.rb
39 lines (32 loc) · 941 Bytes
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'sidekiq/web'
Rails.application.routes.draw do
authenticate :user, lambda { |u| u.admin? } do
namespace :admin do
mount Sidekiq::Web => '/sidekiq'
resources :users, only: [:index]
resources :submissions, only: [:index]
root to: "users#index"
end
end
resources :communities do
resource :subscriptions
end
get 'submissions/unsubscribe/:unsubscribe_hash' => 'submissions#unsubscribe', :as => 'comment_unsubscribe'
get :search, controller: "application"
resources :submissions do
member do
put "upvote", to: "submissions#upvote"
put "downvote", to: "submissions#downvote"
end
resources :comments do
member do
put "upvote", to: "comments#upvote"
put "downvote", to: "comments#downvote"
end
end
end
devise_for :users
resources :users, only: [:show], as: "profile"
resources :premium
root to: "submissions#index"
end