Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Fabio Sussetto's Profile

GitHub User: fabiosussetto

Comments by Fabio Sussetto

Avatar

For those getting the js-rendered HTML auto-escaped, I've solved like this:

  • First, if you're using Rails 3.0.8 there's a bug which prevents html_safe and/or escape_javascript to work correctly. Just update to 3.0.9.

  • Second, in the line in application_helper:
    link_to_function(name, h("add_fields(this, '#{association}', '#{escape_javascript(fields)}')"))

you should remove the h() method call, which double escape the HTML, causing the problem.

Thanks for your great screencasts.