Error message when using .to_xml

Hi,

I’m trying to generate an xml feed. I have an array of posts stored
in an instance variable for this particular action.

I am trying to define the response to an xml request by:

respond_to do |a|
a.xml {render :xml, @posts.to_xml}
a.rss {render :action=>‘rss.rxml’, :layout=> false}
a…atom {render :action=> ‘atom.rxml’, :layout=> false}
end
This is under the list action, btw.

When I request that URL, I get:

private method `sub’ called for :xml:Symbol

Any thoughts on what I’m missing?

Thanks,

Ron

On Mar 30, 7:22 am, Ron [email protected] wrote:

  a..atom {render :action=> 'atom.rxml', :layout=> false}

end
that should be render :xml => @posts.xml

Fred

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