Sha256: e3a2df782b6fdfaa97a9636e4ed126a91f16c982638956621b50eacb91f5d8aa
Contents?: true
Size: 1.07 KB
Versions: 21
Compression:
Stored size: 1.07 KB
Contents
EffectivePosts::Engine.routes.draw do namespace :admin do resources :posts, except: [:show] if EffectivePosts.submissions_enabled && EffectivePosts.submissions_require_approval match 'posts/:id/approve', to: 'posts#approve', via: :get, as: :approve_post end match 'posts/excerpts', to: 'posts#excerpts', via: :get end scope :module => 'effective' do resources :posts, only: ([:index, :show] unless EffectivePosts.submissions_enabled) if EffectivePosts.use_category_routes Array(EffectivePosts.categories).map { |category| category.to_s }.each do |category| next if category == 'posts' match category, to: 'posts#index', via: :get, defaults: {:category => category } match "#{category}/:id", to: 'posts#show', via: :get, defaults: {:category => category } 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
21 entries across 21 versions & 1 rubygems