From a2f655b55eb30a900020e8aff9601ed0606ce58f Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Fri, 3 Sep 2010 23:32:07 +1200 Subject: Hello rails3 support. --- config/routes.rb | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/routes.rb b/config/routes.rb index ce4a2ef..70406de 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,9 +8,9 @@ if Rails.version < '3.0.0' map.namespace(:admin, :path_prefix => 'refinery') do |admin| admin.namespace :blog do |blog| blog.resources :posts - + blog.resources :categories - + blog.resources :comments, :collection => { :approved => :get, :rejected => :get @@ -18,7 +18,7 @@ if Rails.version < '3.0.0' :approved => :get, :rejected => :get } - + blog.resources :settings, :collection => { :notification_recipients => [:get, :post], :moderation => :get @@ -27,5 +27,40 @@ if Rails.version < '3.0.0' end end else - # route for rails3 here. + Refinery::Application.routes.draw do + match '/blog', :to => 'blog_posts#index', :as => 'blog_post' + match '/blog/:id', :to => 'blog_posts#show', :as => 'blog_post' + + match '/blog/categories/:category_id', :to => 'blog_posts#index', :as => 'blog_category' + match '/blog/:id/comments', :to => 'blog_posts#comment', :as => 'blog_post_blog_comments' + + scope(:path => 'refinery', :as => 'admin', :module => 'admin') do + scope(:path => 'blog', :name_prefix => 'admin', :as => 'blog', :module => 'blog') do + root :to => 'posts#index' + resources :posts + + resources :categories + + resources :comments do + collection do + get :approved + get :rejected + end + member do + get :approved + get :rejected + end + end + + resources :settings do + collection do + get :notification_recipients + post :notification_recipients + + get :moderation + end + end + end + end + end end \ No newline at end of file -- cgit v1.2.3