I\'ve tried everything. Every combination of the helpers raw, html_safe to_json including some attempts with ::JSON.encode
raw
html_safe
to_json
::JSON.encode
The problem here is with the "=" string. As it's considered unsafe, it taints the other string.
You can probably do either:
raw("=" + @campaign.to_json)
or
"= #{@campaign.to_json}".html_safe
which are roughly the same.