This project is archived and is in readonly mode.
Atom Feed Helper generates wrong Ids
Reported by Jonny_K | September 22nd, 2008 @ 07:37 PM | in 2.x
Hi!
I think I ran into a bug in the atom feed helper. In my application I have a Blog that can have Comments and I want a atom feed for all the comments.
I create this feed with the atom feed helper:
...
feed.entry([comment.blog,comment]) do |entry|
entry.title(comment.title)
entry.content(comment.body, :type => 'html')
entry.author do |author|
author.name(comment.user.name)
end
end
...
This code generates a valid atom feed but it generates wrong ids for the entries. For instance tag:arche-online.at,2005:Array/-612666458
So the rss reader always marks every comment as new comment because the id changes.
When I change this code to
feed.entry(comment) do |entry|
...
it fails creating the URL for this comment.
In the atom_feed_helper.rb I found this (line 122)
@xml.id(options[:id] || "tag:#{@view.request.host},#{@feed_options[:schema_date]}:#{record.class}/#{record.id}")
It's obvious that this is creating the id of the array and not of the object.
I don't know what a good solution for this would be. So i would appreciate some help on that.
Comments and changes to this ticket
-
Michael Johann September 23rd, 2008 @ 12:30 PM
Jonny,
I guess it would be solved by providing the following:
... feed.entry(comment, :id => comment.id) do |entry| entry.title(comment.title) entry.content(comment.body, :type => 'html') entry.author do |author| author.name(comment.user.name) end end ...
-
Pratik December 23rd, 2008 @ 01:28 PM
- Assigned user set to Pratik
- State changed from new to wontfix
Please submit a failing test case/patch.
-
Ryan Bigg October 21st, 2010 @ 03:38 AM
- Tag changed from 2, actionpack, bug, helper to 2.0-stable actionpack bug helper
Automatic cleanup of spam.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>