Sha256: 8281e36ca495ecb87cd4d6effafbd22ea9f2229dc4c27081e31ba9742808759e
Contents?: true
Size: 671 Bytes
Versions: 6
Compression:
Stored size: 671 Bytes
Contents
# frozen_string_literal: true EffectivePages::Engine.routes.draw do namespace :admin do resources :pages, except: [:show] 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
6 entries across 6 versions & 1 rubygems