#87 Generating RSS Feeds (revised)
May 26, 2012 | 8 minutes | Views
If you have a page containing a dynamic list of records, consider providing an RSS or Atom feed for it. It is quite easy to do with XML Builder and the atom_feed helper method as shown in this episode.
- source codeProject Files in Zip (87.8 KB)
- mp4Full Size H.264 Video (19.6 MB)
- m4vSmaller H.264 Video (12.3 MB)
- webmFull Size VP8 Video (12.5 MB)
- ogvFull Size Theora Video (34.1 MB)
Thanks for the update Ryan. For some reason my html was being interpreted as plain text and escaped so had to add this:
Thanks.. I ran into this as well!
You can also add
For the atom feed, does anyone know how to add an image for each article? I've seen some websites that do that.
This is what I'm experimenting with, not sure if there's a better way:
nm, that doesn't work. I added an image to the summary but that doesn't seem to work either. Still looking for a solution.
This one the other hand will work.
I got 2 models, "User" and "Memberships". Each user has multiple memberships (has_many), and each membership belongs_to an user.
My question is: How do I loop thru each user and each membership? My idea was to build 2 loops, but its not working =/ (Unknown method 'each' for users?)
How can we use fragment caching w/ this?
I'm wondering like @swrobel how we can incorporate fragment caching?
I like to tell you that i like this post very much you are providing the best information.
Lets say I have News and Blog Posts and I have feed for both of these. Do you recommend it from SEO perspective. Should I try to provide a single feed or separate feed depending on the controller. As shown in this railscast. Or have a separate FeedController and have one feed?
Why do you actually want to hack something?