This is a Rails 5 adaptation of an answer to a StackOverflow question regarding using jQuery UJS 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
@coreyward - thanks for the update, and for being willing to push up an update when random people turn up and start asking questions about code you wrote ten months ago. :) That does indeed make the error message go away.
Now, though, the on-ajax-success function simply isn't getting called at all, and I'm not sure how to debug why. No error messages. I can see that the action called by the xhr is returning the right markup (albeit with a 304 Not Modified response, not a 200 OK - maybe that's the problem?) it's just not tripping the function. Baffling. I'm going to chase it a bit longer and then I'll do the SO thing and come back here with any response I get.