Sha256: f94b6b8442780dd27e36d62fc45ce0677b4eb4f668f8ff7c098d971f80343f7d

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

Cambium::Engine.routes.draw do

  namespace :admin do
    get '/' => 'dashboard#index', :as => :root
    get 'dashboard' => 'dashboard#show', :as => :dashboard
    get 'search' => 'search#index', :as => :search
    resources :documents
    resources :pages, :param => :slug
    resources :users
    resources :settings
  end

  if ActiveRecord::Base.connection.table_exists?('cambium_pages')
    Cambium::Page.published.each do |page|
      template = page.template
      next if template.nil? || page.page_path.blank?
      begin
        if template.respond_to?(:controller) && template.respond_to?(:action)
          get page.page_path => "/#{template.controller}##{template.action}"
        else
          get page.page_path => 'pages#show'
        end
      rescue
      end
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cambium-1.3.2 config/routes.rb
cambium-1.3.1 config/routes.rb