In action_view/helpers/prototype_helper.rb, insert_html uses the deprecated Insertion namespace from Prototype.
I think the new method needs to be something like:
def insert_html(position, id, *options_for_render)
content = escape_javascript render(*options_for_render)
record "Element.insert('#{id}', { #{position.to_s}: '#{content}' });"
end
I couldn't get escape_javascript (from javascript_helper) to fire correctly, so I replaced it with:
def insert_html(position, id, *options_for_render)
content = render(*options_for_render).gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
record "Element.insert('#{id}', { #{position.to_s}: '#{content}' });"
end
This does insert the html, but not in the correct position, and throws an RJS error. I may keep toying with this, but I think someone else will have to finish it.
Also, the Insertion namespace is used on line 1011 of trunk, in the options_for_ajax method.