Stack Level Too Deep with recursive partials #11340

Closed
yob opened this Issue Jul 7, 2013 · 1 comment

Comments

Projects
None yet
2 participants

yob commented Jul 7, 2013

We have a comment partial that renders recursively to display child comments.

ie. app/views/comments/_comment.html.erb has the following line:

<%= render partial: 'comments/comment', collection: comment.children %>

While trying to upgrade from rails v3.2.13 to v4.0.0 we're hitting a "Stack Level Too Deep" error, much like the one described in rails/cache_digests#39.

Removing the recursive partial rendering fixes the error (but leaves content off our output).

It only happens if perform caching is enabled in the environment

config.action_controller.perform_caching = true

rafaelfranca added a commit that referenced this issue Jul 7, 2013

Fix "Stack Level Too Deep" error when rendering recursive partials
When rendering recursive partial Action View is trying to generate the
view digest infinitly causing a stack level error.

Fixes #11340

LeonB commented Jul 28, 2013

Thanks for this fix. Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment