Sha256: 0401f88ab1d5a139a02f8f1638b2b98e9c6ac39ac07c0720b751d957d7179452

Contents?: true

Size: 1.21 KB

Versions: 13

Compression:

Stored size: 1.21 KB

Contents

EffectivePosts::Engine.routes.draw do
  namespace :admin do
    resources :posts, except: [:show] do
      post :approve, on: :member

      post :archive, on: :member
      post :unarchive, on: :member
      post :bulk_archive, on: :collection
      post :bulk_unarchive, on: :collection
    end
  end

  scope module: 'effective' do
    # Post Routes
    resources :posts

    # Blog Routes
    match 'blog/category/:category', to: 'posts#index', via: :get, constraints: lambda { |req|
      EffectivePosts.use_blog_routes && EffectivePosts.category(req.params['category']).present?
    }

    resources :posts, only: [:index, :show], path: 'blog', constraints: lambda { |req|
      EffectivePosts.use_blog_routes
    }

    # Category routes
    match ':category', to: 'posts#index', via: :get, constraints: lambda { |req|
      EffectivePosts.use_category_routes && EffectivePosts.category(req.params['category']).present?
    }

    match ":category/:id", to: 'posts#show', via: :get, constraints: lambda { |req|
      EffectivePosts.use_category_routes && EffectivePosts.category(req.params['category']).present?
    }
  end

end

Rails.application.routes.draw do
  mount EffectivePosts::Engine => '/', as: 'effective_posts'
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
effective_posts-2.9.2 config/routes.rb
effective_posts-2.9.1 config/routes.rb
effective_posts-2.9.0 config/routes.rb
effective_posts-2.8.0 config/routes.rb
effective_posts-2.7.4 config/routes.rb
effective_posts-2.7.3 config/routes.rb
effective_posts-2.7.2 config/routes.rb
effective_posts-2.7.1 config/routes.rb
effective_posts-2.7.0 config/routes.rb
effective_posts-2.6.2 config/routes.rb
effective_posts-2.6.1 config/routes.rb
effective_posts-2.6.0 config/routes.rb
effective_posts-2.5.0 config/routes.rb