Moving to 2.0 glitches: RSS

December 6th, 2007

While moving a project to Rails 2.0RC I bumped into the fact that old-style RSS generation didn't work anymore. The code I was using before was:
1
2
3
  def rss
    render  :layout =>  false
  end
And the template was named rss.rxml What it became after some googling and trial-and-failure:
1
2
3
4
5
6
  def index
    request.format = :rss
    respond_to do |format|
      format.rss  { render :layout => false }
    end
  end
And the template (the same one, actually) is now named index.rss.builder. The weird thing was that I tried to use :xml instead of :rss, and it didn't work. Anyway, it's working fine now.

Sorry, comments are closed for this article.