ruby-on-railsxsserubis

Rails 2.3.5 with rails_xss escaping content_for yielded content


Just upgraded Rails to 2.3.5 to get the lovely looking rails_xss plugin but I've noticed one big issue with it. Any content_for blocks are escaped when yielded.

I've tried hacking it around by doing the either of following but they do not work:

<% @content_for_foo.html_safe! -%>
<%= yield raw :foo %>

Solution

  • Try <%= raw yield :foo %>