铁轨-Caches_action expire_action
-
22-10-2019 - |
题
我想到期一个缓存的动作,并想知道如何生成正确的参考。
#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)
因此,这几乎可以,除了主机丢失。我该怎么办将其提供给Expire_Action方法?
提前致谢。
解决方案
利用 article_posts_url(:article_id => post.article)
resource_name_url
路由与主机集生成URL。
不隶属于 StackOverflow