Comments (2)
I have the same issue, using Rails 4.0.0. When I try to cache a segment with recursion, I get this error:
SystemStackError at /testing-webcast/sections
=============================================
> stack level too deep
activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb, line 23
Here is the code from my app
models/section.rb
class Section < ActiveRecord::Base
...
# Relations
belongs_to :webcast
belongs_to :speaker
belongs_to :parent, class_name: Section
has_many :children, class_name: Section, foreign_key: :parent_id
# Scopes
default_scope -> { order(:position) }
scope :root, -> { where parent_id: nil }
....
end
sections/_webcast.html.erb
<% cache [ 'sections', sections.maximum(:updated_at).to_i ] do %>
<%= render 'sections/list', sections: sections.root %>
<% end %>
sections/_list.html.erb
<ul>
<% sections.each do |section| %>
<li>
<div class="section webcast animate">
<h2><%= section.get_title %></h2>
</div>
<% if section.children.count > 0 %>
<%= render 'sections/list', sections: section.children %>
<% end %>
</li>
<% end %>
</ul>
Everything works, if I remove this part.
...
<% if section.children.count > 0 %>
<%= render 'sections/list', sections: section.children %>
<% end %>
...
Other thing is that, after I remove the part from above, the cache is created.
After this I add the part again to the template, remove the cache manually (delete the files)
and it starts to work.
from cache_digests.
Try this way...
<% if section.children.count > 0 %>
<%= render sections: section.children, partial: 'sections/list' %>
<% end %>
from cache_digests.
Related Issues (20)
- Custom template resolvers and digest caching. HOT 1
- belongs_to association not touching correctly HOT 2
- 'stack level too deep' with recursive partial HOT 5
- How to calculate the render speed after using cache digest? HOT 1
- v. 0.3.0: "wrong number of arguments (1 for 2)" argument error HOT 2
- Register erb tracker for slim
- Question: Using read_multi when appropriate HOT 1
- Not detecting correct partial for model.association HOT 1
- Release to RubyGems? HOT 3
- Calling cache([object]) and cache(object) Using the Same Key HOT 5
- The generated keys of item and items which size is 1 are the same HOT 2
- Missing rake tasks in Rails 4 HOT 4
- cannot load such file -- active_support/cache/memory_store HOT 1
- problem when using fragment caching without digests
- Would it make sense to accept a proc as a way to specify explicit dependencies? HOT 1
- Jbuilder support HOT 1
- template dependencies aren't being calculated at all? HOT 1
- Overwrite cache content with dynamic parts HOT 3
- Expire partial template?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cache_digests.