I was going through some controllers today and AJAX'ing several forms by replacing my start_form_tag with form_remote_tag. One of the actions that my form was submitting to fell through to an RJS template that had a simple replace_html directive. The weird thing was that this particular RJS was spitting out garbage on my page. It was showing special characters like line feeds, carriage returns (\n, \r) etc. all over the page.

After about an hour of fiddling with this I finally found the problem. I mistakenly put an :update attribute in my form_remote_tag. Somehow this was causing a conflict with the RJS template calls. After removing the :update attribute, everything worked fine.

Hopefully someone with the same issue stumbles across this early on in their search.