José Valim
2008-May-11 14:45 UTC
[PATCH] caches_action extension (with :if and :layout keys)
I just sent a patch to Lighthouse that extends caches_action functionality. A couple of changes were made to ActionController::Caching::Actions: * Added conditional option (:if) to caches_action method (just like in caches_page) * Added :layout flag to caches_action method. If you specify :layout => false, the layout will not be cached, only the action content. This is useful since most application has user info in the layout. If the :layout is not set (nil) or set to true, we have the default behavior. * Changes were documented * Tests were added * Test bug fix: added sleep(0.01) to assure that Time.now will be different. [], José Valim. ps: I''m just sending this e-mail cause Lighthouse says so. Apologies if I am off-topic. =) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
José Valim
2008-May-11 14:48 UTC
Re: [PATCH] caches_action extension (with :if and :layout keys)
Ops, the patch is here: http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/166 But You would have guessed. =P [], José Valim. On Sun, May 11, 2008 at 4:45 PM, José Valim <jose.valim@gmail.com> wrote:> I just sent a patch to Lighthouse that extends caches_action > functionality. > > A couple of changes were made to ActionController::Caching::Actions: > > * Added conditional option (:if) to caches_action method (just like > in caches_page) > > * Added :layout flag to caches_action method. If you specify :layout > => false, the layout will not be cached, only the action content. This > is useful since most application has user info in the layout. If > the :layout is not set (nil) or set to true, we have the default > behavior. > > * Changes were documented > > * Tests were added > > * Test bug fix: added sleep(0.01) to assure that Time.now will be > different. > > [], > José Valim. > > ps: I''m just sending this e-mail cause Lighthouse says so. Apologies > if I am off-topic. =) >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---