Creating ATOM feeds
|
|
At the last meeting I mentioned that it was really easy to create an ATOM feed for your resources in edge rails. Here’s what I did: Install the atom_feed_helper:
The README gave me enough info to get started with it, and then I used “curl” on the command line (Mac or Linux) to debug the output by doing, say,
This would return the XML ATOM feed for all comments (calls the index action). Two things to be noted about that URL:
One gotcha that the README example didn’t include: I put my feeds in the same controller as my other code, so my default layout was wrapping the feed. Not good. I had to include a call to “render :layout => false” to prevent that. Here’s the index action from my comments controller: and here’s app/views/comments/index.atom.builder: |