From 2661f048e81bccfb4e7419473cf1cc5cfa03a6f1 Mon Sep 17 00:00:00 2001 From: patriot Date: Wed, 25 Jan 2017 13:04:00 +0200 Subject: [PATCH] fix caches_action with layout false --- lib/action_controller/caching/actions.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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