I just came across a blog that mentions a j function in Rails. They were using it to do ajax style page updates.
j
$(\'#cart\').html(\"<%=j render
escape_javascript(javascript) Escapes carriage returns and single and double quotes for JavaScript segments. Also available through the alias j().
escape_javascript(javascript)
Escapes carriage returns and single and double quotes for JavaScript segments.
Also available through the alias j().
From the the rails docs.