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
Just to update the above in case someone comes back to it: this is the Stack Overflow question about my latest bug. I don't think it's related to Corey's gist specifically; the
ajax:success
event doesn't seem to get tripped, which other SO question/answers I've found suggest may be more of an issue with the Ajax response than with anything included here.