Topic: modularize javascript code in rails app

I have a rails app that uses livevalidation to ajax-validate some form fields, and the same javascript validation code exists on multiple pages (for example, everywhere that password and confirmation is validated).

I thought I might be able to DRY this up using a partial but that doesn't seem to work in the javascript.  If this was php I would simply include a file containing the common javascript, but what would be the best way to do this in rails 2.3.8?

Re: modularize javascript code in rails app

can't you include it by moving your js in a file in public/javascripts and using <script> tag in head?