This is a Rails 3.1 adaptation of an answer to a StackOverflow question regarding using jQuery to display AJAX-retrieved content in a modal. Here is the original answer:
http://stackoverflow.com/questions/5766055/jquery-modal-windows-and-edit-object/5766232#5766232