Easy RSS Feed in Ruby on Rails
Last week Ron and I decided that we should include an RSS feed on dishAdish. The idea was to show all the latest comments on dishes and restaurants for the site. Our hope is that by including the feed as a site map on Google Webmaster Tools, it will help our latest changes get indexed quicker. The problem was, neither of us knew anything about RSS feeds, let alone how to implement it within our Ruby on Rail web environment.
I started out, as usual, by doing some quick searches on Google. I found a few references to various Ruby on Rails packages to implement feed and feed readers, but they all seemend a bit complicated for what we wanted. Then I ran across a very simple solution in a post from Paul Sturgess Ruby on Rails Snippets called Creating an RSS feed in Ruby on Rails. This was just what I wanted. By adding 5 lines of code to my controller and creating a very simple RXML view, I was able to easily create The Latest Dish at dishAdish. Further, by adding a simple <link/> directive to the site template, this feed can be automatically discovered by browsers.
Ruby on Rails is pretty cool stuff…





