I am facing some problem with action cache and content_for. Once I set an action for action cache, it does not run content_for code mentioned in the view even first time. I understand that once the cache is created, it will not be run anymore. However the issue is that it is not ran even first time. Here is the snipped of the code:
Controller:
caches_action :aboutus, :layout => false
Views:
<%= title “about us” %>
application_helper.rb:
def title(page_title)
content_for (:title) { page_title }
end
Layout:
<%= yield(:title) %>I cleared my cache (rm -rf tmp/cache/*) and reloaded the browser, but still the title is not set. Any idea?
Thanks
Sanchit