Forum: Ruby on Rails RSS Feed Implementation Issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9a901866d0d0ac3338adc4a283d00ca1?d=identicon&s=25 Andrea o. k. Wright (aok)
on 2005-11-23 09:47
Hi All.

I was pleasantly surprised to see how easy it is to use a Builder
template to format the xml for the RSS feed I'm implementing. There were
lots of helpful example on the Web to follow.

My problem has to do with serving the feed.

The feed is initiated in the rss method in my xml_controller; there's
also an rss.rxml.

If I point my browser to localhost:3000/xml/rss, the content appears in
xml format and looks ***just right***. But my feed reader chokes when I
give it that URL.

If I point to localhost:3000/xml/rss in my browser and do a "save as
/public/xml/rss.xml", my feed reader has no trouble finding the file and
displays its contents flawlessly.

Does an actual .xml file really need to be saved somewhere? I didn't
think that was necessary?

Any hints would be greatly appreciated.

What am I missing?

Thanks,

AOK
Cf7e5e4b5ca573eec214191fac420a2f?d=identicon&s=25 dave (Guest)
on 2005-11-23 11:30
(Received via mailing list)
On Wednesday 23 Nov 2005 08:47, Andrea O. K. Wright wrote:
> If I point my browser to localhost:3000/xml/rss, the content appears in
> xml format and looks ***just right***. But my feed reader chokes when I
> give it that URL.
> Any hints would be greatly appreciated.
> What am I missing?

Are you setting the MIME type correctly (in your xml_controller, on the
rss
action)?  Should be:

headers['Content-Type'] = "application/rss+xml"

~Dave

--

Dave Silvester
Rent-A-Monkey Website Development
Web: http://www.rentamonkey.com/
9a901866d0d0ac3338adc4a283d00ca1?d=identicon&s=25 Andrea o. k. Wright (aok)
on 2005-11-23 18:59
(Received via mailing list)
Thank you for your help Dave.

My feed reader was able to read the feed with that format. But when I
use
"application/rss+xml" with Firefox, I get the "Open With\Save As" dialog
when I browse to localhost:3000/xml/rss and IE gives me the message that
it
"cannot download rss from localhost".

I switched to "application/xml; charset=utf-8" per
http://wiki.rubyonrails.com/rails/pages/HowtoChang.... With
this
format both Firefox and IE quietly display the feed content -- and the
feed
reader is also fine with the URL "localhost:3000/xml/rss".

AOK
This topic is locked and can not be replied to.