-
-
Notifications
You must be signed in to change notification settings - Fork 277
/
Copy pathroutes.rb
32 lines (28 loc) · 1000 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
Rails.application.routes.draw do
root to: redirect(Avo.configuration.root_path)
devise_for :users
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
get "hey", to: "home#index"
authenticate :user, ->(user) { user.is_admin? } do
mount Avo::Engine, at: Avo.configuration.root_path
# Uncomment to test constraints /123/en/admin
# scope ":course", constraints: {course: /\w+(-\w+)*/} do
# scope ":locale", constraints: {locale: /\w[-\w]*/} do
# mount Avo::Engine, at: Avo.configuration.root_path
# end
# end
# TODO: support locale based routes
scope "(:locale)" do
# mount Avo::Engine, at: Avo.configuration.root_path
end
end
end
if defined? ::Avo
Avo::Engine.routes.draw do
get "custom_tool", to: "tools#custom_tool", as: :custom_tool
scope :resources do
get "courses/cities", to: "courses#cities"
get "users/get_users", to: "users#get_users"
end
end
end