Atom feed和rss阅读器
问题描述:
我正在尝试为页面添加一个Atom feed,但它只是继续旋转并添加所有项目(如果只添加了一个新项目)。我究竟做错了什么?Atom feed和rss阅读器
http://legionaere.de/posts.atom?team_slug=1_team
我使用的是默认atom_feed助手从Rails3中
答
我认为你需要添加类似公布的pubdate的条目:
而且还格式的日期。
例如:
atom_feed do |feed|
feed.title("Posts")
feed.pubDate(CGI.rfc1123_date(@posts.first.created_at))
feed.published(CGI.rfc1123_date(@posts.first.created_at))
feed.updated(CGI.rfc1123_date(@posts.first.created_at))
@posts.each do |post|
feed.entry(:url => post_path(post)) do |entry|
entry.title(post.title)
entry.pubDate(CGI.rfc1123_date(post.created_at))
entry.published(CGI.rfc1123_date(post.created_at))
entry.updated(CGI.rfc1123_date(post.created_at))
end
end
end
+0
是饲料和条目中的额外pubDate字段是否有诀窍,发布和更新可以忽略,因为它们是开箱即用的。谢谢 – antpaw 2012-03-24 22:15:19
你尝试下面我给解决? – 2012-02-28 06:04:10