开发者

rails - caches_action expire_action

开发者 https://www.devze.com 2023-01-02 01:56 出处:网络
I want to expire a cached action and wondered how to generate the correct reference. #controller caches_action :index, :layout => false

I want to expire a cached action and wondered how to generate the correct reference.

#controller
caches_action :index, :layout => false
#generates this fragment which works fine
views/0.0.0.0:3000/article/someid/posts

#sweeper
...
expire_action article_posts_path(:article_id => post.article)
# results in this
Expired fragment: views//en/article/someid/posts (0.0ms)

So this is almost ok, except the host is missing. What do I do that supplies this to the expire_action method?

Thanks in advan开发者_运维知识库ce.


Use article_posts_url(:article_id => post.article)

resource_name_url routes generate url with the host set.

0

精彩评论

暂无评论...
验证码 换一张
取 消