Forum: Ruby on Rails Javascript Troubles

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
eric (Guest)
on 2005-11-14 04:38
(Received via mailing list)
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:

<a href="#" onclick="new
'}, '/business/delete_category/126', {asynchronous:true,
evalScripts:true}); return false;"><img alt="Delete"
src="/images/delete.gif" /></a>

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

This topic is locked and can not be replied to.