-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathroutes.rb
44 lines (34 loc) · 978 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
40
41
42
43
44
require 'sidekiq/web'
VegastechApp::Application.routes.draw do
admin_constraint = lambda do |request|
if user_id = request.session['user_id']
User.find(user_id).admin?
end
end
constraints admin_constraint do
mount Sidekiq::Web, at: '/sidekiq'
end
get 'sessions/create'
resources :tags, only: [:show, :index]
resources :events, only: :index
resources :posts do
resources :votes
end
resources :photos do
resources :votes
resources :comments
end
resources :stories do
resources :votes
resources :comments
end
resources :sessions, only: [:create, :destroy]
match '/rss/:count', to: 'rss#index', format: 'rss'
match '/auth/:provider/callback', to: 'sessions#create'
match '/sign_out', to: 'sessions#destroy'
match '/recent', to: 'info#recent'
match '/about', to: 'info#about'
match '/supporters', to: 'info#users'
match '/best_of_week/', to: 'info#best_of_week'
root to: 'stories#index'
end