我正在尝试从我的“Posts”模型设置一个简单的Atom Feed,并且在Rails 2和Rails 3之间遇到了翻译问题。
我尝试通过以下两个步骤完成此任务:
1. 将
我尝试通过以下两个步骤完成此任务:
1. 将
<%= auto_discovery_link_tag(:atom) %>
添加到我的/views/layouts/application.html.erb文件中。
2. 创建/views/posts/index.atom.builder文件。该文件包含:atom_feed do |feed|
feed.title("Daily Deal")
feed.updated(@posts.first.created_at)
@posts.each do |post|
feed.entry(post) do |entry|
entry.title(post.title)
entry.content(post.body, :type => 'html')
entry.author { |author| author.name("Justin Zollars")}
end
end
end
我在浏览器中看到了RSS链接,但是打开链接时出现了错误:
Too many redirects occurred trying to open
“feed:http://localhost:3000/posts”.
This might occur if you open a page
that is redirected to open another
page which then is redirected to open
the original page.
我哪里出了问题?