See this blog post: http://paydrotalks.com/posts/45-standard-json-response-for-rails-and-jquery
In your Rails 3
Then run the following rake task and follow the instructions:
You're all set!
Peter Bui email@example.com