Javascript Troubles


I’m have some troubles with some javascript that is being generated. I
have the following in my view.

:update => {
:success => update_element_function(
:action => :remove)
:url => {
:action => “delete_category”,
:id =>

So we have a link_to_remote() function that calls a action and then
remove a bit of HTML on success. Seems fairly harmless. But the
following is generated:


As you can see the success code has single quotes in it but the success
code is in a single quote itself. This causes a syntax error. Any