2012-02-16 159 views

回答

2

我认为你需要添加类似公布的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