Sha256: a90ec5282f4e3fcad514bfc844392ad57825fed73a06e4c919312d51eb59bf8b

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

class PageConstraints
  def matches?(request)
    !request.path.start_with?("/admin/auth")
  end
end

Rails.application.routes.draw do

  devise_for :admin, :path => "admin", :controllers => {
    :omniauth_callbacks => "admin/auth/omniauth_callbacks",
    :passwords          => "admin/auth/passwords",
    :sessions           => "admin/auth/sessions",
  }

  namespace :admin do
    match 'site_maps' => 'site_maps#index', :as => :root # Devise redirects here after sign in
    match 'site_maps' => 'site_maps#index'
    match 'site_maps/update' => 'site_maps#update'
    match 'pages/search' => 'page_search#show'
    resources :pages, :except => [:index, :edit] do
      resources :entries, :only => [:index]
    end
    resources :assets
    resources :snippets
    resources :admins
  end
  match '/admin' => redirect('/admin/site_maps')

  match 'slices/templates(/:slice)/:name.:format' => 'static_assets#templates'
  match ':action/:asset_type(/:folder)/*name.:format' => 'static_assets',
    :constraints => {
    :asset_type => /(stylesheets|javascripts|images)/,
    :action => /(slices|sites)/
  }, :as => :static_assets

  match ':status.html' => 'pages#virtual_error_pages'
  match '*path' => 'pages#create', :via => :post
  match '*path' => 'pages#show', :as => :page, :constraints => PageConstraints.new

  root :to => 'pages#show'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slices-1.0.2 config/routes.rb
slices-1.0.1 config/routes.rb