Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Handle Validation Errors

#54

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

Reported by Jordan Carter · February 25th, 2009 @ 03:57 PM

State: new
Assigned to: nobody

Activity

  1. Joshua Vickery
    Joshua Vickery
    • Milestone set to ObjectiveResource 1.1

    February 26th, 2009 @ 07:25 AM

  2. Adam Alexander
    Adam Alexander

    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!

    March 11th, 2009 @ 12:50 AM

  3. Joshua Vickery
  4. Joshua Vickery
    Joshua Vickery
    • Assigned user set to Joshua Vickery

    March 14th, 2009 @ 11:19 AM

  5. Joshua Vickery
  6. Joshua Vickery
    Joshua Vickery
    • Title changed from Display Error Messages to Handle Validation Errors

    March 18th, 2009 @ 07:22 PM

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.