I’m having a problem in Rails 2 where respond_to is always rendering the
RXML view even in the HTML rendering response. Can anyone tell me why
this might be happening? Here’s a code snippet:
respond_to do |accepts|
accepts.html
accepts.xml { render :action => ‘show.rxml’, :layout => false}
end
The only idea I have is that maybe you don’t need to use render :action.
Instead, maybe you should be getting some XML from somewhere (such as
calling #to_xml on a model or collection) and rendering it like this?
respond_to do |accepts|
accepts.html
accepts.xml { render :xml => some_model.to_xml }
end