Sha256: 58b93b98e64bab5c2915e149f6eee5dcca6a36a60cecc6f39e8c84a30e4fe140

Contents?: true

Size: 1.39 KB

Versions: 8

Compression:

Stored size: 1.39 KB

Contents

Rails.application.routes.draw do

  namespace :admin do
    resources :post_categories
  end

  SpudBlogConfig.each do |config|
    blog_key = config.key

    namespace :admin do
      resources :posts, :path => blog_key, :blog_key => blog_key do
        match :preview, on: :collection, via: [:post, :patch]
      end
    end

    scope config.path do

      # Blog Post Categories
      get 'category/:category_url_name(/page/:page)' => 'posts#category',
        :as => "#{blog_key}_category",
        :blog_key => blog_key,
        :defaults => {:page => 1}

      # Blog Post Archives
      get 'archive/:archive_date(/page/:page)' => 'posts#archive',
        :as => "#{blog_key}_archive",
        :blog_key => blog_key,
        :defaults => {:page => 1}

      # Blog Post Category + Archive
      get 'category/:category_url_name/:archive_date(/page/:page)',
        :controller => 'posts',
        :action => 'category',
        :as => "#{blog_key}_category_archive",
        :blog_key => blog_key,
        :defaults => {:page => 1}

      # Category/Archive filtering
      post '/', :controller => 'posts', :action => 'filter', :blog_key => blog_key

      # Blog Posts
      get '/(page/:page)' => 'posts#index',
        :as => "#{blog_key}_posts",
        :blog_key => blog_key,
        :defaults => {:page => 1}

      get ':id' => 'posts#show', :as => "#{blog_key}_post", :blog_key => blog_key
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tb_blog-1.4.4 config/routes.rb
tb_blog-1.4.3 config/routes.rb
tb_blog-1.4.2 config/routes.rb
tb_blog-1.3.5 config/routes.rb
tb_blog-1.4.1 config/routes.rb
tb_blog-1.4.0 config/routes.rb
tb_blog-1.3.4 config/routes.rb
tb_blog-1.4.beta1 config/routes.rb