Oracle Magazine Special offer for AjaxImpact.com Visitors!! Subscribe to Oracle Magazine for Free!
AJAX IMPACT


ARTICLES
AJAX validation in Rails
04/01/2006, By BigSmoke



This article explains how BigSmoke handled ActiveRecord validation messages and other notices caused by AJAX requests. The text is written in XHTML 2 and converted client-side to XHTML 1, which means it might be difficult to read in some outdated browsers such as IE.

The problem:

I wanted AJAX requests in Rails to result in error handling and message reporting that was at least as nice (and almost as easy) as doing the same thing without AJAX.

A solution:

Let me start with a short summary of the steps I followed to get easy, transparent error handling for AJAX requests.

  • Make validation errors cause a 4xx HTTP error.


  • Store validation error messages within the flash.


  • Pass the flash to the browser through the X-JSON header.


  • Extract the validation error messages and other flash notices from the X-JSON header using a custom AJAX responder.


  •    Read More...

     Rate this Ajax Articles
     Rating: 8.6 out of 45 votes cast

    AJAX NEWS
    04/01/2007 wxJavaScript : porting wxWidgets to JavaScript.
    03/31/2007 DED|Chain - The web developers JavaScript Kit
    03/30/2007 Clipperz Crypto Library - a JavaScript library of crypto primitives
    03/28/2007 ETech - AJAX Unplugged Slides
    03/27/2007 Stripe Generator: ajax powered web 2.0 tool!
    03/26/2007 Finally Microsoft joins the OpenAjax Alliance


    INDUSTRY NEWS
    05/19/2006 Ajax grabs center stage at JavaOne, By Tony Baer
    05/15/2006 Oracle to boost AJAX, Java , By Paul Krill
    05/13/2006 Open AJAX Group Drafts Development Plans, By Stacy Cowley
    05/13/2006 AJAX Powers Interactive Marketing ASP, By AjaxWorld News Desk
    05/12/2006 AJAX Experts Tackle Security, Other Issues , By Darryl K. Taft
    05/11/2006 Adobe Releases Spry Framework for AJAX, By AjaxWorld News Desk
    More 
           

          © 2008 ajaximpact.com. All rights reserved.