My controller has this:
caches_action :render_ticker_for_channel, :expires_in => 30.seconds
In my routes file I have this:
match '/render_c_t/:channel_id' => 'render#render_ticker_for_channel', :as => :render_channel_ticker
In the log file I see this:
Write fragment views/mcr3.dev/render_c_t/63 (11.6ms)
How do I expire this manually? I need to expire this from a different controller than the render controller, but even within the render controller I can't get it to expire the right thing.
If I do:
expire_action(:controller => 'render', :action => 'render_ticker_for_channel', :id => c.id)
I see:
Expire fragment views/mcr3.dev/render/render_ticker_for_channel/63 (3.2ms)
If I do:
expire_action(:controller => 'render', :action => 'render_c_t', :id => c.id)
I see:
Expire fragment views/mcr3.dev/render/render_c_t/63 (3.2ms)
This:
expire_action("render_c_t/#{c.id}")
produces:
Expire fragment views/render_c_t/63 (3.5ms)
How can I get it to expire the same path that 'caches_action' is producing?!
Use the regex version of expire_fragment:
expire_fragment %r{render_c_t/#{c.id}/}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With