Sha256: 762566688197c0f23fbef7f6b5d82df7bd8628bc74bce18e814fb53f3c227b8b

Contents?: true

Size: 732 Bytes

Versions: 3

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true

EffectivePages::Engine.routes.draw do
  namespace :admin do
    resources :pages, except: [:show]
    resources :page_sections, only: [:index, :edit, :update]
    resources :menus, only: [:index]
  end

  scope module: 'effective' do
    match '*id', to: 'pages#show', via: :get, as: :page, constraints: lambda { |req|
      Effective::Page.find_by_slug_or_id(req.path_parameters[:id] || '/').present?
    }
  end
end

# Automatically mount the engine as an append
Rails.application.routes.append do
  unless Rails.application.routes.routes.find { |r| r.name == 'effective_pages' }
    mount EffectivePages::Engine => '/', as: 'effective_pages'
  end
end

#root to: 'effective/pages#show', id: 'home'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_pages-3.3.2 config/routes.rb
effective_pages-3.3.1 config/routes.rb
effective_pages-3.3.0 config/routes.rb