Sha256: 3201b25035e0009d45814b1a875dabca76fa24db1fcbc7994ca97fd764183684
Contents?: true
Size: 885 Bytes
Versions: 7
Compression:
Stored size: 885 Bytes
Contents
EffectivePosts::Engine.routes.draw do namespace :admin do resources :posts, :except => [:show] match 'posts/excerpts', :to => 'posts#excerpts', :via => [:get] end scope :module => 'effective' do resources :posts, :only => [:index, :show] if EffectivePosts.use_category_routes EffectivePosts.categories.each do |category| next if category.to_s == 'posts' match "#{category}", :to => 'posts#index', :via => [:get], :defaults => {:category => category.to_s } match "#{category}/:id", :to => 'posts#show', :via => [:get], :defaults => {:category => category.to_s } end end end end # Automatically mount the engine as an append Rails.application.routes.append do unless Rails.application.routes.routes.find { |r| r.name == 'effective_posts' } mount EffectivePosts::Engine => '/', :as => 'effective_posts' end end
Version data entries
7 entries across 7 versions & 1 rubygems