diff --git a/lib/action_controller/caching/actions.rb b/lib/action_controller/caching/actions.rb index 0127d61..b464e4f 100644 --- a/lib/action_controller/caching/actions.rb +++ b/lib/action_controller/caching/actions.rb @@ -124,7 +124,8 @@ def _save_fragment(name, options) end if caching_allowed? - write_fragment(name, content, options) + result = write_fragment(name, content, options) + result.respond_to?(:html_safe) ? result.html_safe : result else content end