One other place to look is the Prototype + Script.aculo.us book by Christophe Portenueve. He didn't want his examples to be too Rails-centric, so he wrote a very simple Ruby CGI to handle all the back-end for the Ajax examples. That might have some good bits for you to pick at.