views:

8

answers:

0

I'm generating html and js to send to my page via AJAX. That part works great - everything renders fine, and my ampersands are escaped.

When I user action_cache, the data in the cache file has un-escaped ampersands in the textual portions of my html (links remain escaped). So, it breaks when it tries to update the page.

Why does the cache do this, and how can I stop it from happening?

I'm using ruby 1.8.7, rails 2.3.5 and prototype 1.6.0.

edit:

I've come up with an inefficient way of doing it, but it works:

format.js {
  render(:partial=>'mcol')
  response.body.gsub!(/&/, '&').gsub!(/&/, '&')
}

Does anyone have a better way of doing it?