Hey Doug,
There is a lot of information like that in the api:
http://api.rubyonrails.com/classes/ActiveResource/Base.html
I might also suggest you create a quick scaffold and check out the
controller it creates, as the format.xml that it returns in each
method covers your question mostly. Example with html cut out:
respond_to do |format|
if @machine.save
format.xml { render :xml => @machine, :status
=> :created, :location => @machine }
else
format.xml { render :xml => @machine.errors, :status
=> :unprocessable_entity }
end
end
Hope that helps.
Cheers
- Jamie van Dyke
- Chief Technical Officer
- Parfait
On 17 Jul 2008, at 03:22, doug livesey wrote:
> Hallo -- I'm writing a RESTful web service with ActiveResource, and
> now need to handle things like how to tell the client calling the
> service that things have gone well (a 200 response, I think), or
> have failed for some reason (validations or otherwise).
> Can anyone offer any pointers to the codes I need, how to send them,
> & how to piggyback any extra information (like details of why an
> action failed) onto the codes?
> Cheers,
> Doug.