【发布时间】:2015-03-08 09:45:10
【问题描述】:
我正在控制台中查看如何计算缓存摘要依赖项。这适用于 app/views/posts/show.html.haml 模板:
ActionView::Digestor.new(name: "posts/show", finder: finder).digest
# => Cache digest for app/views/posts/show.html.haml: 42bf3496bacfcf84492d8c05d81305fe
这些都不适用于 app/views/posts/_post.html.haml 模板:
ActionView::Digestor.new(name: "posts/_post", finder: finder).digest
# => Couldn't find template for digesting: posts/_post
ActionView::Digestor.new(name: "posts/post", finder: finder).digest
# => Couldn't find template for digesting: posts/post
(对于两者,finder = ApplicationController.new.lookup_context)
如何告诉 ActionView 寻找这个部分?
【问题讨论】:
标签: ruby-on-rails ruby actionview cache-digests