液体中的部分
我们正在尝试将当前的观点从 ERb 重写为 Liquid,但我们遇到了以下问题: 我们的代码中有很多 render(:partial => '/path/to/partial')
,但是我们完全没有发现如何在 Liquid 中渲染部分的说明。 我们找到的唯一一个解决方案是在 render_to_string
的帮助下,但它太丑陋了,令人难以置信。
We're trying to rewrite our current views from ERb to Liquid and we got following problem:
we have a lot of render(:partial => '/path/to/partial')
in our code, but we found absolutely no instructions how to render partials in Liquid. The only one solution we found was with help of render_to_string
but it's just too ugly to be true.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Liquid 方法是使用
include
标签: http:// /liquid.rubyforge.org/classes/Liquid/Include.html(我知道文档不是很有帮助。这是一篇显示示例用法的帖子:http://forums.shopify.com/categories/2/posts/1629)
The Liquid way is to use the
include
tag: http://liquid.rubyforge.org/classes/Liquid/Include.html(I know that documentation isn't very helpful. Here's a post that shows an example usage: http://forums.shopify.com/categories/2/posts/1629)