Sha256: 33989012fd388d56927373945b9c3b482b7acd04ab895d0bdaaa05cd9e570478

Contents?: true

Size: 889 Bytes

Versions: 2

Compression:

Stored size: 889 Bytes

Contents

# frozen_string_literal: true

Spina::Engine.routes.draw do
  namespace :blog do
    root to: 'posts#index'

    get ':id', to: 'posts#show', as: :post

    # Redirects for old sites that used the old blog path
    get 'posts/', to: redirect('/blog'), as: :old_index
    get 'posts/:id', to: redirect('/blog/%{id}'), as: :old_post

    get 'feed.atom', to: 'posts#index', as: :rss_feed, defaults: { format: :atom }
    get 'categories/:id', to: 'categories#show', as: :category
    get 'archive/:year(/:month)', to: 'posts#archive', as: :archive_posts
  end

  namespace :admin, path: Spina.config.backend_path do
    namespace :conferences do
      namespace :blog do
        resources :categories
        resources :posts, except: :show do
          collection do
            get :live
            get :draft
            get :future
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spina-admin-conferences-blog-0.1.1 config/routes.rb
spina-admin-conferences-blog-0.1.0 config/routes.rb