Rails 3-有关Atom Feed的帮助?

问题描述

| 感觉就像我一直在转转,遵循了各种教程,都提出了达到预期结果的建议,但没有一个对我有用。我正在使用Kaminari插件,并且我的文章在索引页面(6)。有人可以帮助我吗?谢谢 application.html.rb
auto_discovery_link_tag(:atom) # =>
<link rel=\"alternate\" type=\"application/atom+xml\" title=\"ATOM\" href=\"http://www.currenthost.com\" />
routes.rb
match \'/feed\' => \'articles#feed\',:as => :feed,:defaults => { :format => \'atom\' }
article_controller.rb
def index
@articles = Article.published.page(params[:page]).per(6).ordered

respond_to do |format|
  format.html # index.html.erb
  format.atom  { @articles = Article.published }
  format.xml  { render :xml => @articles }
end
end
article / index.atom.builder
atom_feed do |feed|
feed.title \"Title\"
feed.updated(@articles.blank? ? Time.now : @articles.first.created_at)

@articles.each do |article|
feed.entry article do |entry|
entry.title article.title
entry.content article.body,:type => \'html\'

entry.author do |author|
author.name article.author
end
end
end
end
    

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)