Rails-caches_action expire_action
我想要使缓存的操作过期,并想知道如何生成正确的引用。
#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方法?
提前致谢。
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 advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
article_posts_url(:article_id => post.article)
resource_name_url
路由通过主机集生成 url。Use
article_posts_url(:article_id => post.article)
resource_name_url
routes generate url with the host set.