score:2

Accepted answer

This is happening because Rails 3 escapes all view strings by default, whereas rails 2 left them raw by default.

The trick here is to get that formatter line rendered raw:

<%= raw("options.tooltip.formatter = function() {return 'This is text and this is <b>bold</b>!'; }") %>

In the standard rails idiom:

<%= raw "options.tooltip.formatter = function() {return 'This is text and this is <b>bold</b>!'; }" %>

More good info on Rails HTML escape practices here:

https://stackoverflow.com/a/3906207/1195261


Related Articles