Why is my rxml view being wrapped by the rhtml template in views/
layouts?
I was experimenting with REST, I had a nice little test program with
one table: ‘resources’. Here’s what the show method looks like:
def show
@resource = Resource.find(params[:id])
respond_to do |accepts|
accepts.html
accepts.xml
end
end
I have a show.rhtml and show.rxml views.
I could see the html doing this:
curl -H ‘Accept: application/xml’ http://localhost:3000/resource/show/1
and the xml doing this:
curl -H ‘Accept: application/xml’ http://localhost:3000/resource/show/1
And it worked … then I must have done something wrong and went to
dinner. Now I’m back and every request I make asking for xml runs
layouts/resource.layout. This causes the effect of having my xml
output wrapped by the html generated by the standard layout template.
Thanks for any ideas!