Sha256: ff4c86fefbe1fd081bdf187e4478266e7b68f4e6bd7c3d3c47501496ecd4cb4c

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

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
    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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slices-2.0.2 config/routes.rb
slices-2.0.1 config/routes.rb
slices-2.0.0 config/routes.rb