Rss double render problem

I have a simple method

def activities
@headers[“Content-Type”] = “application/xml; charset=utf-8”

activities = get_activities
@feed =
@feed.title = "Activities" = "Cogini"
@feed.copyright = "Cogini 2005-2006" = "http://localhost:3000/admin/customers/"
@feed.content = "Activities"
activities.each do |a|
  @feed_item =
  @feed_item.feed = @feed
  @feed_item.content = activity_link(a)
  @feed.entries << @feed_item
render :inline => "<?xml version='1.0'

encoding=‘UTF-8’?>\n#{@feed.build_xml(‘rss’, 2.0)}"

That builds a feed from a set of fixed values + some dynamic data, but I
cannot get it to build the correct rss.

@feed.build_xml returns a string - not the XMLBuilder as promised, so I
simply concatenated the xml header and tried to render, but now I get a
DoubleRenderError - I can’t see anywhere else in this where I render

I’ve also looked at the xml howto and the feedtools tutorial, neither of
them adequately explain how to do what I want - indeed following them
hasn’t brought me any closer to getting this working


On Wed, 2005-12-14 at 15:22 +0700, Kev J. wrote: = "http://localhost:3000/admin/customers/"

hasn’t brought me any closer to getting this working


Three things that might help.

I think the problem is that you’re doing an inline render, but the
method is finishing and it still wants to use the view template.

Solution one: move your inline render to the view, since you already
have @feed available.

Solution two: Not sure if this will work exactly, but what happens if
you render :text instead of :inline?

Solution three: Also not sure if this is the issue or not, but if you
return false from your action, I believe it should suppress rendering of
the template.

  • Jamie

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs