limit atom feed to 50 items
This commit is contained in:
@@ -4,7 +4,7 @@ class BlogpostsController < ApplicationController
|
|||||||
before_filter :auth, except: [:index, :show]
|
before_filter :auth, except: [:index, :show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@posts = Blogpost.all.reverse
|
@posts = Blogpost.order("created_at desc")
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ atom_feed do |feed|
|
|||||||
feed.title "Redstoner News"
|
feed.title "Redstoner News"
|
||||||
feed.updated Time.now
|
feed.updated Time.now
|
||||||
|
|
||||||
@posts.each do |post|
|
@posts.limit(50).each do |post|
|
||||||
feed.entry post do |entry|
|
feed.entry post do |entry|
|
||||||
entry.updated post.updated_at
|
entry.updated post.updated_at
|
||||||
entry.author do |a|
|
entry.author do |a|
|
||||||
|
|||||||
Reference in New Issue
Block a user