Hi!
I want to cache some fragment to place in a sidebar of my default layout,
and i want to use content_for to place it.
It the API it says:
NOTE: Beware that content_for is ignored in caches. So you
shouldn''t use it for elements that are going to be fragment
cached.
I am not really sure what means, because i have tried placing a cache block
inside a content_for block and it looks that it works.
I want to know if i am using it correctly and wether it will be a problem in
the future because that''s not supposed to work.
In my general layout i have:
/app/views/layout/general.html.erb :
...
<div id="divsidebar">
<%= yield :sidebar %>
</div>
...
In mi view, i have:
/app/views/controller/index.html.erb :
...
<% content_for :sidebar do %>
<% cache(:action_suffix => "tagcloudcache") do %>
...
<%= render(:partial => "tagcloud") %>
<% end %>
<% end %>
...
My question is:
Is that not supposed to work? Because it works. Is there a better way of
doing it?
Thanks a lot for your attention!!
-- M
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---