Ruby-on-Rails: Help with render: layout => false

I am trying to access a rails app resource from an API (it sends an Application/XML GET request) and I would like to not have to parse the XML file.

In my resources controller I have the following:

def get_resource
    @my_resource = Resources.new
    render :xml => @my_resource
end

which produces an xml file as expected. If i replace it with:

render :layout => false

my API reports a "template missing" error. I've also tried the following:

render :xml => @identity, :layout => false

But the page renders anyway. What's the right way to go about this?

5
задан edgerunner 2 December 2010 в 12:56
поделиться