Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragment caching with cache_digests #15

Open
balancedcomp opened this issue Mar 7, 2014 · 2 comments
Open

Fragment caching with cache_digests #15

balancedcomp opened this issue Mar 7, 2014 · 2 comments

Comments

@balancedcomp
Copy link

Receiving the following error only when using caching.

ActionView::Template::Error: undefined local variable or method `view_cache_dependencies' for #<#<Class:0x007fa2e4a3c008>:0x007fa2e9fd4510>
    from /Users/jarrettgreen/.rvm/gems/ruby-1.9.3-p429@balancedcomp/gems/cache_digests-0.3.1/lib/cache_digests/fragment_helper.rb:22:in `fragment_for'
    from /Users/jarrettgreen/.rvm/gems/ruby-1.9.3-p429@balancedcomp/gems/actionpack-3.2.17/lib/action_view/helpers/cache_helper.rb:36:in `cache'
    from /Users/jarrettgreen/code/balanced-comp/app/views/scenario_entries/_scenario_entry.html.haml:1:in `_app_views_scenario_entries__scenario_entry_html_haml__1591820996871809986_70168843571460'

Using the following method in a model:

  def build_html
    render :partial => 'scenario_entries/scenario_entry',
           :locals => {:scenario_entry => self, :@scenario => self.scenario},
           :formats => :html
  end

Partial looks like this:

-cache scenario_entry do 
  %tr.strong
    %td=scenario_entry.employee.full_name_reversed
    %td=scenario_entry.employee.position.title
    %td{:colspan => 2}

    #etc

Using
render_anywhere (0.0.8)
cache_digests (0.3.1)
Rails 3.2.17

robb1e added a commit that referenced this issue Apr 27, 2014
@robb1e
Copy link
Contributor

robb1e commented Apr 27, 2014

view_cache_dependencies is from cache_digests. Can you try this branch from the commit listed above and see if that fixes your issue?

@feliperaul
Copy link

If I use that ref I get this error:

NoMethodError: undefined method helper_method' for RenderAnywhere::RenderingController:Class from /Users/x/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/cache_digests-0.3.1/lib/cache_digests/view_cache_dependency.rb:9:inblock in module:ViewCacheDependency'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants