RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: fabiosussetto
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.
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.