The escape_javascript method in ActionView escapes the apostrophe \' as backslash apostrophe \\\', which gives errors when parsing as JSON.
\'
\\\'
For
May need more details here, but JSON strings must use double quotes. Single quotes are okay in JavaScript strings, but not in JSON.