Sha256: 88a5a9de83022f8e093c9cd4e0bb1748fa2b3bdc8bcc6c102178f2d9064a3ddd

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

Rails.application.routes.draw do
  
  scope :module => :blog do
    namespace :admin, :path => ComfyBlog.config.admin_route_prefix do
      resources :posts, :except => [:show] do
        resources :comments, :only => [:index]
      end
      resources :comments, :only => [:index, :destroy] do
        put :publish, :on => :member
      end
      resources :tags, :except => [:show]
    end unless ComfyBlog.config.admin_route_prefix.blank?
  end
  
  scope ComfyBlog.config.public_route_prefix, :module => :blog do
    get ''                   => 'posts#index', :as => :blog_posts
    get 'tag/:tag'           => 'posts#index', :as => :tagged_blog_posts
    get 'category/:category' => 'posts#index', :as => :categorized_blog_posts
    
    with_options :constraints => { :year => /\d{4}/, :month => /\d{1,2}/ } do |o|
      o.get ':year'               => 'posts#index', :as => :year_blog_posts
      o.get ':year/:month'        => 'posts#index', :as => :month_blog_posts
      o.get ':year/:month/:slug'  => 'posts#show',  :as => :dated_blog_post
    end
    
    get ':id' => 'posts#show', :as => :blog_post
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
comfy_blog-0.0.0 config/routes.rb