aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authordougbradbury <doug@8thlight.com>2013-06-16 12:02:34 -0500
committerdougbradbury <doug@8thlight.com>2013-06-16 12:02:34 -0500
commitefc12fae1871142bd0cee733f8a7b1d02e519ff2 (patch)
treeacdee1a3755ebdd3917a385744f53845a87445fe /app
parentccff7c06b5b1aa863c7021c3e253ccc866b37b1d (diff)
downloadrefinerycms-blog-efc12fae1871142bd0cee733f8a7b1d02e519ff2.tar.gz
refinerycms-blog-efc12fae1871142bd0cee733f8a7b1d02e519ff2.tar.bz2
refinerycms-blog-efc12fae1871142bd0cee733f8a7b1d02e519ff2.zip
limit rss feed for some services that have limits (like feedburner)
Diffstat (limited to 'app')
-rw-r--r--app/controllers/refinery/blog/posts_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb
index 999b49a..dbb2af8 100644
--- a/app/controllers/refinery/blog/posts_controller.rb
+++ b/app/controllers/refinery/blog/posts_controller.rb
@@ -10,7 +10,11 @@ module Refinery
def index
# Rss feeders are greedy. Let's give them every blog post instead of paginating.
- (@posts = Post.live.includes(:comments, :categories)) if request.format.rss?
+ if request.format.rss?
+ @posts = Post.live.includes(:comments, :categories)
+ #limit rss feed for services (like feedburner) who have max size
+ @posts = Post.recent(params["max_results"]) if params["max_results"].present?
+ end
respond_with (@posts) do |format|
format.html
format.rss { render :layout => false }