<% cache do %>
<%= something_expensive() %>
<% end %>
Raises an exception ...
ActionView::TemplateError (undefined local variable or method
`_erbout' for #<ActionView::Base:0x3652d24>) on line #31 of app/views/
home/index.html.erb:
28: </div>
29: <div id="threeColWrap">
30: <div id = "col_1">
31: <% cache do %>
32: <div id = "col-1-head">
I've tried it on both CentOS 5.2 and OSX 10.5, both configured to run
with Rails 2.2.2
I've googled for the error, but all I came across was the same problem
reported a year ago in this group ...
I find it hard to believe I'm the first person to come across such a
basic and presumably important part of rails being broken in 2.2.2 ...
but maybe ?.
I'd appreciate any help on how to correct it or work around it ...
short of yanking fragment caching from the app.
We saw something like this when we had a version of erubis being
required in tucked away corner of one of our initializers, check for
stuff like that as well.
Turns out I had the old timed_fragment_cache plugin residing in the
code, and though I wasn't actually using it anywhere in my current
codeline ... it was still being loaded.
I found a fix for timed_fragment_cache at ruzee.com (http://
www.ruzee.com/blog/2008/07/timed_fragment_cache-on-rails-21/).
Steffan points out ... "With Rails 2.1 cache_erb_fragment has been
replaced by write_fragment. This breaks a plugin I really enjoy to
use: timed_fragment_cache by Richard Livsey".
Steffan updated the plugin to 0.2 and provided it in zipped form on
the link above ... and I can confirm that it works fine in rails
2.2.2.
Thanks for the help, and hope the discussion helps someone else :0)