aboutsummaryrefslogtreecommitdiffstats
path: root/config/routes.rb
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-08-28 18:15:53 +1200
committerPhilip Arndt <parndt@gmail.com>2010-08-28 18:15:53 +1200
commit21dca99ddf7eadb929bc9fe40a6b3f9fd90b2f41 (patch)
tree920043fe637f02bde2ca7a41b9c714e6fd7633f1 /config/routes.rb
parente6fead06dcc6c27e47df83533b53256beabc21a5 (diff)
downloadrefinerycms-blog-21dca99ddf7eadb929bc9fe40a6b3f9fd90b2f41.tar.gz
refinerycms-blog-21dca99ddf7eadb929bc9fe40a6b3f9fd90b2f41.tar.bz2
refinerycms-blog-21dca99ddf7eadb929bc9fe40a6b3f9fd90b2f41.zip
wrote rails engine for later, added ability to add comments and see ones already posted.
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb39
1 files changed, 22 insertions, 17 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 36e80f9..fabb925 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,20 +1,25 @@
-ActionController::Routing::Routes.draw do |map|
- map.blog_post '/blog', :controller => :blog_posts, :action => :index
- map.blog_post '/blog/:id', :controller => :blog_posts, :action => :show
- map.blog_category '/blog/categories/:category_id', :controller => :blog_posts, :action => :index
+if Rails.version < '3.0.0'
+ ActionController::Routing::Routes.draw do |map|
+ map.blog_post '/blog', :controller => :blog_posts, :action => :index
+ map.blog_post '/blog/:id', :controller => :blog_posts, :action => :show
+ map.blog_category '/blog/categories/:category_id', :controller => :blog_posts, :action => :index
+ map.blog_post_blog_comments '/blog/:id/comments', :controller => :blog_posts, :action => :comment
- 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
- }
- blog.resources :settings, :collection => {
- :notification_recipients => [:get, :post],
- :moderation => :get
- }
+ 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
+ }
+ blog.resources :settings, :collection => {
+ :notification_recipients => [:get, :post],
+ :moderation => :get
+ }
+ end
end
end
-end
+else
+ # route for rails3 here.
+end \ No newline at end of file