如何编写可与 HAML 和 ERB 一起渲染的视图助手?
您好,我正在开发一个 gem ,它定义了一些视图助手,它严重依赖于 concat 和 capture 方法,但是我最近发现它不适用于 HAML(还没有彻底测试,但到目前为止还没有渲染 concat(nated) 的东西)。
我在某处读到有一个 haml_concat 版本的 concat。因此,如果我只需要将 concat 调用更改为 haml_concat 调用以使其与 HAML 一起使用,我如何判断我是使用 haml 还是 erb 来调用相应的方法?
谁能提供一个使用 concat 和 capture 与 erb 和 haml 一起使用的视图助手的示例?
:)
Hi I am working on a gem that defines a few view helpers and it heavily relies on concat and capture methods but I've recently discovered it doesn't work with HAML (haven't tested thoroughly, but so far doesn't render concat(nated) stuff).
I read somewhere there was a haml_concat version of concat. So If I just need to change my concat calls to haml_concat calls for it to work with HAML, how can I tell if I am using haml or erb to call the corresponding method?
Can anyone provide an example of a view helper using concat and capture that works with erb and haml?
:)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论