Skip to content

upstill/LiveTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This is a minimal Rails app that demonstrates a bug in render_to_string when using renders within a template in the context ofActionController::Live.

The bug is this: after collecting HTML using render_to_string, an attempt to embed that string in a JSON response fails NON-DETERMINISTICALLY. Sometimes the response text is the appropriate JSON string, sometimes it is the original HTML.

To demo the bug, run Rails v. 4.0.3 under Ruby 1.9.3 and load /lt/page. Clicking the Hit Me button sends off a JSON request to lt/ping, then appends the result to the page.

Clicking the link repeatedly produces sometimes the right and sometimes the wrong result, seemingly at random.

If you go into the lt controller and comment out the declaration of ActionController::Live, the result is consistently correct.

Note: this is a completely generic Rails app, minimally modified to show the bug.

About

Minimal demo of bug in ActionController::Live

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published