RESTFul and AJAX

have you tried using respond_to?

respond_to do |type|          type.js { render } # renders create.rjs          type.html { redirect_to :action => "index" }          type.xml do            headers["Location"] = post_url(:id => @post)            render(:nothing, :status => "201 Created")          end        end