Google Groups Home
Help | Sign in
ActiveResource return codes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
doug livesey  
View profile
 More options 17 Jul, 11:22
From: "doug livesey" <biot...@gmail.com>
Date: Thu, 17 Jul 2008 11:22:55 +0100
Local: Thurs 17 Jul 2008 11:22
Subject: ActiveResource return codes

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.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jamie van Dyke  
View profile
 More options 17 Jul, 15:46
From: Jamie van Dyke <ja...@parfa.it>
Date: Thu, 17 Jul 2008 07:46:31 -0700
Local: Thurs 17 Jul 2008 15:46
Subject: Re: [NWRUG] ActiveResource return codes
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:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
doug livesey  
View profile
 More options 17 Jul, 16:21
From: "doug livesey" <biot...@gmail.com>
Date: Thu, 17 Jul 2008 16:21:42 +0100
Local: Thurs 17 Jul 2008 16:21
Subject: Re: [NWRUG] Re: ActiveResource return codes

That helps absolutely loads -- cheers, man!

2008/7/17 Jamie van Dyke <ja...@parfa.it>:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google