#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.



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
feed.icon '/assets/icons/feed.gif'
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:
entry << "<media:thumbnail url=\"#{post.thumbnail.tiny}\" width='200' height='200' />".html_safenm, 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.
Hi,
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?
First sign in through GitHub to post a comment.