Atom订阅和RSS阅读器

3
我正在试图为页面添加Atom feed,但它只是一直在旋转,并且如果只有一个新项被添加,它就会添加所有的项。我做错了什么?
我正在使用rails3中的默认atom_feed辅助工具。 http://legionaere.de/posts.atom?team_slug=1_team

你尝试过我下面给出的解决方案了吗? - Sur Max
1个回答

2
我认为你需要添加类似于published的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

是的,在提要和条目中添加了额外的pubDate字段就可以了,因为发布和更新都已经默认包含在内了。谢谢。 - antpaw

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接