Handle Validation Errors
Reported by Jordan Carter | February 25th, 2009 @ 03:57 PM | in ObjectiveResource 1.1
Retrieve the error messages generated by Rails in the creation of new models.
if @person.save
flash[:notice] = 'Person was successfully created.'
format.html { redirect_to(@person) }
format.xml { render :xml => @person }
format.json { render :json => @person }
else
format.html { render :action => "new" }
format.xml { render :xml => @person.errors, :status => :unprocessable_entity }
format.json { render :json => @person.errors, :status => :unprocessable_entity }
end
Comments and changes to this ticket
-
Joshua Vickery February 26th, 2009 @ 07:25 AM
- Milestone set to ObjectiveResource 1.1
-
Adam Alexander March 11th, 2009 @ 12:50 AM
I've made some good progress with this tonight I believe:
http://github.com/adamalex/objec...
This initial commit has full support for JSON with unit tests that demonstrate the functionality. When switching into XML mode some unit tests fail so the XML support for this new functionality still needs attention. I would be happy to investigate further as time allows or would be just fine with someone else jumping in with any ideas. I do need to call it a night so I wanted to go ahead and get this up here. Have a good night!
-
Joshua Vickery March 12th, 2009 @ 08:01 AM
above pulled into 1.1: http://github.com/yfactorial/obj...
-
Joshua Vickery March 14th, 2009 @ 11:19 AM
- Assigned user set to Joshua Vickery
-
Joshua Vickery March 14th, 2009 @ 11:21 AM
- Assigned user cleared.
-
Joshua Vickery March 18th, 2009 @ 07:22 PM
- Title changed from Display Error Messages to Handle Validation Errors
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Port of Rails' ActiveResource framework to the iPhone.
People watching this ticket
Tags
Referenced by
- 65 Store raw error message bodies If the response is not a success, the error message shoul...