Hello All,

In Ruby if I have the string:

<a href="#" onclick="new
Ajax.Request('/accounts/todo_lists/1/todo_items/2', {asynchronous:true,
evalScripts:true, parameters:'authenticity_token=' +
encodeURIComponent('0523c2646f11e096ef9ecd2f6e5b41690f99fc39')}); return
false;">Remove</a>

How would I go about replacing the single quotes ', with a backslash and
single quote? \'

Ultimately I'd like to arrive at the string below:

<a href="#" onclick="new
Ajax.Request(\'/accounts/todo_lists/1/todo_items/2\',
{asynchronous:true, evalScripts:true, parameters:\'authenticity_token=\'
+ encodeURIComponent(\'0523c2646f11e096ef9ecd2f6e5b41690f99fc39\')});
return false;">Remove</a>

Every variation of GSUB that I've tried has yet to yield that second
string.  Any assistance would be greatly appreciated.

Thank you,

Binh
-- 
Posted via http://www.ruby-forum.com/.