there is already a prototype library you can try out
http://rubyforge.org/projects/codeforpeople/