Not too long ago, I showed you how to create a blog archive for your Rails blog. Well, creating an RSS feed for your Rails blog might not necessarily increase SEO like a Google Sitemap can, but it’s a helluva great way to stay in touch with your readers.
Here’s a walk through for integrating RSS with your Rails blog.
RSS and Ruby on Rails - The Full Story
In Rails, this call sends all RSS calls to index.rss.builder by default. Let’s take a look at what that View does.
This is where all the Railsy magic happens. In another language, in another web application framework, this could’ve easily been ugly. But with Rails, we’re talking rainbows and ponies baby!
You just implemented the RSS specification in Ruby on Rails. Congrats! Let’s keep moving, we’re almost done.
You can get browsers to auto-detect your Rails blog rss feed with a single line of Ruby on Rails code:
Or, if you want, you can use straight XHTML to get browsers to auto-detect your Rails blog rss feed:
That’s it, now mere mortals can subscribe to your feed and get inside the mind of a Rails master. Dramatic, I know!
Have fun and Good Luck!