diff options
author | Uģis Ozols <ugis@ugisozols.com> | 2013-06-17 01:37:26 -0700 |
---|---|---|
committer | Uģis Ozols <ugis@ugisozols.com> | 2013-06-17 01:37:26 -0700 |
commit | 49813243e0d1aff18548ffc014e751a937e0f974 (patch) | |
tree | a06adbc3455fd6b5a10692431fb7a5ec1733d126 /app/controllers | |
parent | ccff7c06b5b1aa863c7021c3e253ccc866b37b1d (diff) | |
parent | 8f6c29e18aec5ea5f9df96d62ed0778a2b470c3e (diff) | |
download | refinerycms-blog-49813243e0d1aff18548ffc014e751a937e0f974.tar.gz refinerycms-blog-49813243e0d1aff18548ffc014e751a937e0f974.tar.bz2 refinerycms-blog-49813243e0d1aff18548ffc014e751a937e0f974.zip |
Merge pull request #333 from dougbradbury/master
Limit rss feed length with query param
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/refinery/blog/posts_controller.rb | 6 |
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 } |