Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [Rails] caching compiled templates

Reply
Thread Tools

[Rails] caching compiled templates

 
 
Andreas Schwarz
Guest
Posts: n/a
 
      09-29-2004
Hi,

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

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
 
Reply With Quote
 
 
 
 
Andreas Schwarz
Guest
Posts: n/a
 
      09-29-2004
Andreas Schwarz wrote:
> Hi,
>
> I'm using the following code for template caching in Rails:
> http://codepaste.org/view/paste/188
>
> 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.patch.txt
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I create a page, then it's compiled upon first request, where cani find the compiled code?? lander ASP .Net 5 03-05-2008 04:34 PM
re compiled object result caching? Dan Python 4 08-29-2007 10:20 PM
how to Specializations of function Templates or Overloading Function templates with Templates ? recover C++ 2 07-25-2006 02:55 AM
g++ compiled C++ code called from gcc compiled C code Klaus Schneider C++ 1 12-02-2004 01:44 PM
Templates templates templates JKop C++ 3 07-21-2004 11:44 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57