Sha256: 4f9cd91c7969aeae8165faa5f75993ddecb55e6dc2f2fe0f40028286aaae8db0

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

PagesCms::Engine.routes.draw do

  resources :articles,    only: [:show]
  resources :contacts,    only: [:create]

  namespace :admin do
    resources :pages,     except: [:show, :new]
    resources :images,    only:   [:create, :index, :destroy]
    resources :articles,  only:   [:index, :create, :update, :destroy]
    resources :contacts,  only:   [:index, :destroy]
    resources :accounts
    post '/pages/order'   => 'pages#order'
    post '/accounts/site' => 'accounts#site'
  end

  if PagesCms.const_defined?('Account')
    PagesCms::Account.where("mount_location != '/'").each do |account|
      get "/#{account.mount_location}/:parent/:slug"  => 'pages#show', account: account.id
      get "/#{account.mount_location}/:slug"          => 'pages#show', account: account.id
      get "/#{account.mount_location}/"               => 'pages#home', account: account.id
    end

    raccount = PagesCms::Account.where(mount_location: '/').first
    if raccount
      get '/:parent/:slug'  => 'pages#show', account: raccount.id, root: true
      get '/:slug'          => 'pages#show', account: raccount.id, root: true
      get '/'               => 'pages#home', account: raccount.id, root: true, as: :root
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pages_cms-2.1.1 config/routes.rb
pages_cms-2.0.1 config/routes.rb
pages_cms-2.0.0 config/routes.rb