-
Notifications
You must be signed in to change notification settings - Fork 16
/
routes.rb
37 lines (31 loc) · 1.14 KB
/
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
class PageConstraints
def matches?(request)
!request.path.start_with?('/admin/auth')
end
end
Rails.application.routes.draw do
devise_for :admin, Slices::Config.devise_for_options
namespace :admin do
get 'site_maps' => 'site_maps#index', as: :root # Devise redirects here after sign in
get 'site_maps' => 'site_maps#index'
put 'site_maps/update' => 'site_maps#update'
get 'pages/search' => 'page_search#show'
resources :pages, :except => [:index, :edit] do
resources :entries, :only => [:index]
end
resources :assets, :except => [:show]
resources :snippets
resources :admins
end
get '/admin' => redirect('/admin/site_maps')
get 'slices/templates(/:slice)/:name.:format' => 'static_assets#templates'
get ':action/:asset_type(/:folder)/*name.:format' => 'static_assets',
:constraints => {
:asset_type => /(stylesheets|javascripts|images)/,
:action => /(slices|sites)/
}, :as => :static_assets
get ':status.html' => 'pages#virtual_error_pages'
post '*path' => 'pages#create'
get '*path' => 'pages#show', as: :page, :constraints => PageConstraints.new
root to: 'pages#show'
end