[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[Rails] caching compiled templates

Andreas Schwarz

9/29/2004 1:06:00 PM

Hi,

I'm using the following code for template caching in Rails:
http://codepaste.org/view...

This basically works, but there is one problem. Example:

Controller:
class SomeController
def a
@var = "action a"
end

def b
@var = "action b"
end

def c
# don't set @var
end
end

View:
<%= @var %>

When I call the action a I get the result "action a".
When I call the action b I get the result "action b".
No surprise so far.
But when I call the action c, which doesn't set @var, I don't get "",
instead I get whatever the value of @var was in the action that was
called before c. So if I call a,c I get two times "action a", if I call
b,c I get two times "action b".

Any idea how this problem could be solved?

Thanks
Andreas
1 Answer

Andreas Schwarz

9/29/2004 2:36:00 PM

0

Andreas Schwarz wrote:
> Hi,
>
> I'm using the following code for template caching in Rails:
> http://codepaste.org/view...
>
> This basically works, but there is one problem.

I have found a workaround. The full patch against the Rails CVS version
is here:
http://213.146.167.224/caching_templates...