File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
lib/action_controller/caching Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -173,11 +173,21 @@ def around(controller)
173
173
body = controller . _save_fragment ( cache_path . path , @store_options )
174
174
end
175
175
176
- body = controller . render_to_string ( plain : body , layout : true ) unless cache_layout
176
+ body = render_to_string ( controller , body ) unless cache_layout
177
177
178
178
controller . response_body = body
179
179
controller . content_type = Mime [ cache_path . extension || :html ]
180
180
end
181
+
182
+ if ActionPack ::VERSION ::STRING < '4.1'
183
+ def render_to_string ( controller , body )
184
+ controller . render_to_string ( text : body , layout : true )
185
+ end
186
+ else
187
+ def render_to_string ( controller , body )
188
+ controller . render_to_string ( plain : body , layout : true )
189
+ end
190
+ end
181
191
end
182
192
183
193
class ActionCachePath
You can’t perform that action at this time.
0 commit comments