Sha256: 76c280e74b75658b8d78e272701106f883c5951b9f755a8d9115e65eddaddb91
Contents?: true
Size: 672 Bytes
Versions: 11
Compression:
Stored size: 672 Bytes
Contents
class EffectivePagesConstraint def self.matches?(request) Effective::Page.find(request.path_parameters[:id] || '/').present? rescue false end end EffectivePages::Engine.routes.draw do namespace :admin do resources :pages, except: [:show] end scope :module => 'effective' do get '*id', to: 'pages#show', constraints: EffectivePagesConstraint, as: :page 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
11 entries across 11 versions & 1 rubygems