I highly recommend using jQuery with Ruby on Rails ... it makes it much easier and will be standard, as in the next version (3.1).
In jQuery you are doing something like:
$('#my_field').change(function() {
$('#result').val(function() {
do something...
});
});
js.erb Ruby JS . Ryan Bates Railscasts Javascript RoR .
, NetTuts + JavaScript Rails 3.