aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAmanda Wagener <amanda@resolvedigital.co.nz>2010-12-01 11:43:26 +1300
committerAmanda Wagener <amanda@resolvedigital.co.nz>2010-12-01 11:43:26 +1300
commitc38d9c3da5b9b21df07c4c7ebc8617413977c7fb (patch)
tree6feb6b3557630c5243eead5307320660a8201f2a /config
parenta1f7ea061ea2c9694a383c8d20137628a178d979 (diff)
downloadrefinerycms-blog-c38d9c3da5b9b21df07c4c7ebc8617413977c7fb.tar.gz
refinerycms-blog-c38d9c3da5b9b21df07c4c7ebc8617413977c7fb.tar.bz2
refinerycms-blog-c38d9c3da5b9b21df07c4c7ebc8617413977c7fb.zip
Remove all Rails2/Rails3 checks as master is now Rails3 only
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb90
1 files changed, 27 insertions, 63 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 2cb4723..20fa1b1 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,73 +1,37 @@
-if Rails.version < '3.0.0'
- ActionController::Routing::Routes.draw do |map|
- map.namespace(:blog) do |blog|
- blog.rss_feed 'feed.rss', :controller => 'posts', :action => 'index', :format => 'rss'
- blog.root :controller => "posts", :action => 'index'
- blog.post ':id', :controller => "posts", :action => 'show'
- blog.category 'categories/:id', :controller => "categories", :action => 'show'
- blog.post_blog_comments ':id/comments', :controller => 'posts', :action => 'comment'
-
- ## what is the rails2 syntax for this? sorry ;__;
- # get 'archive/:year/:month', :to => 'posts#archive', :as => 'archive_blog_posts'
- end
-
- 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
- }, :member => {
- :approved => :get,
- :rejected => :get
- }
-
- blog.resources :settings, :collection => {
- :notification_recipients => [:get, :post],
- :moderation => :get
- }
- end
- end
+Refinery::Application.routes.draw do
+ scope(:path => 'blog', :module => 'blog') do
+ root :to => 'posts#index', :as => 'blog_root'
+ match 'feed.rss', :to => 'posts#index.rss', :as => 'blog_rss_feed'
+ match ':id', :to => 'posts#show', :as => 'blog_post'
+ match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
+ match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
+ get 'archive/:year/:month', :to => 'posts#archive', :as => 'archive_blog_posts'
end
-else
- Refinery::Application.routes.draw do
- scope(:path => 'blog', :module => 'blog') do
- root :to => 'posts#index', :as => 'blog_root'
- match 'feed.rss', :to => 'posts#index.rss', :as => 'blog_rss_feed'
- match ':id', :to => 'posts#show', :as => 'blog_post'
- match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
- match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
- get 'archive/:year/:month', :to => 'posts#archive', :as => 'archive_blog_posts'
- end
- scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
- scope(:path => 'blog', :as => 'blog', :module => 'blog') do
- root :to => 'posts#index'
- resources :posts
+ scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
+ scope(:path => 'blog', :as => 'blog', :module => 'blog') do
+ root :to => 'posts#index'
+ resources :posts
- resources :categories
+ resources :categories
- resources :comments do
- collection do
- get :approved
- get :rejected
- end
- member do
- get :approved
- get :rejected
- end
+ 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
+ resources :settings do
+ collection do
+ get :notification_recipients
+ post :notification_recipients
- get :moderation
- end
+ get :moderation
end
end
end