Sha256: c07190df5509e22a5450ce0ef09cc07963c1d6950847bfb605c9d3b54a933e04

Contents?: true

Size: 824 Bytes

Versions: 14

Compression:

Stored size: 824 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 :page_banners, except: [:show]
    resources :menus, only: [:index]
    resources :carousel_items, except: [:show]
  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

14 entries across 14 versions & 1 rubygems

Version Path
effective_pages-3.4.13 config/routes.rb
effective_pages-3.4.12 config/routes.rb
effective_pages-3.4.11 config/routes.rb
effective_pages-3.4.10 config/routes.rb
effective_pages-3.4.9 config/routes.rb
effective_pages-3.4.8 config/routes.rb
effective_pages-3.4.7 config/routes.rb
effective_pages-3.4.6 config/routes.rb
effective_pages-3.4.5 config/routes.rb
effective_pages-3.4.4 config/routes.rb
effective_pages-3.4.3 config/routes.rb
effective_pages-3.4.2 config/routes.rb
effective_pages-3.4.1 config/routes.rb
effective_pages-3.4.0 config/routes.rb