Getting Javascript to talk to Rails

You'll need to make an ajax request. You should be able to draw some
inspiration from the remote_function rails helper (which will
generate the right bit of js that you can then reuse).

Fred