rails/actionpack-action_caching

caches_action with layout: false produces escaped html output on uncached response

Closed this issue · 10 comments

jonn commented

As of actionpack-action_caching 1.2.0, I’m getting escaped HTML for the output of a caches_action action when there is no cache to serve. When the action is already cached, the HTML output is not escaped and pages look/function as expected.

class HomeController < ApplicationController

  caches_action :index, layout: false

  …

end

Reverting to actionpack-action_caching 1.1.1 restores the expected behavior (html not escaped whether action output is cached or not).

this PR #42 fix it

jonn commented

Yes, I have confirmed that the change in PR #42 fixes this problem with actionpack-action_caching 1.2.0 for me. Thanks @nazarok!

Bitten by this. Any chance for this being merged?

I've too had this issue... but secondly, I am getting my layout inside my layout...

screen shot 2017-07-19 at 11 40 21

My guess was that the originally the page + layout was cached so ran rake tmp:cache:clear but this has not resolved the issue.

I believe this was also raised (but misunderstood) by @vishaljagtap-tudip in his comment in #47.

@jonn @jogaco @nazarok @antulik Have you experienced this issue?

Don't remember if I had layout inside layout. I do remember escaped html output. I am now using @antulik fork which solves the problem

@jogaco Thanks, tried using the fork, no luck.

Just checked.
This works for me:
gem 'actionpack-action_caching', github: 'antulik/actionpack-action_caching', ref: '8c6e52c69315d67437f480da5dce4b7c8737fb32'

This produces an escaped html output.
gem 'actionpack-action_caching'

also checked and @antulik fork fixes the problem for me.

Ran into this and #42 works for us.

@rafaelfranca any chance of getting this merged and a new release out please?