I completly missed the introduction of as_json in rails 2.3.3. And I think I am not the only one, as the there are not many posts about that topic out there. Anyway, using as_json feels so much cleaner than overwriting to_json. And apart from that there is not much more which changes. In your controller you still specify something like

wants.js { render :json => @my_object.to_json }

but it will try to load the data from your models as_json method, in which you can just provide a hash. I really like it this way, as you can create really complex json responses with all the ruby features you love. And the best, it seems as the options which are passed to the to_json method are handed over to your as_json method as well. So custom configuration is not a problem.