From d8a2fe3eec07192ebc03600d6123720338d26ea2 Mon Sep 17 00:00:00 2001 From: Jack Kinsella Date: Fri, 22 Jul 2011 06:54:28 -0700 Subject: Using preferred "defaults" hash to set format of blog/feed.rss to "rss". --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 1793edb..e26fe64 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ ::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 'feed.rss', :to => 'posts#index', :as => 'blog_rss_feed', :defaults => {:format => "rss"} 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' -- cgit v1.2.3 From 216959f3b4b5fea363bc66eb4f5e7d7b77976328 Mon Sep 17 00:00:00 2001 From: Jack Kinsella Date: Fri, 22 Jul 2011 06:56:46 -0700 Subject: Blog:PostsController#index doesn't paginate the blog posts if an rss feed is requested. --- app/controllers/blog/posts_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 9dc595c..edac5ab 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -8,6 +8,8 @@ module Blog respond_to :html, :js, :rss def index + # Rss feeders are greedy. Let's give them every blog post instead of paginating. + (@blog_posts = BlogPost.live.includes(:comments, :categories).all) if request.format.rss? respond_with (@blog_posts) do |format| format.html format.rss -- cgit v1.2.3