将 .rhtml 视图转换为 .html.erb 等
在将旧的 Rails 应用程序迁移到 2.3.10 时,我遇到了 这篇博文,其中有一个很好的 rake 任务,可以将 .rhtml
文件转换为 .html.erb
、。 rjs
到 .js.rjs
,.haml
到 .html.haml
等。但是,当我运行它时,我发现部分尚未更新,因为 rake 任务中的正则表达式在进行转换时会跳过部分。
在博客文章评论中,有人提到新的命名方案不适用于部分,这就是正则表达式的原因。有谁知道他指的是什么?这是一个在 Edge Rails 中存在了一段时间但随后得到纠正的错误吗?
In migrating an old Rails app to 2.3.10, I ran across this blog post that has a nice rake task to convert .rhtml
files to .html.erb
, .rjs
to .js.rjs
, .haml
to .html.haml
, etc. However, when I ran it I found that the partials hadn't be updated, because the regex in the rake task skips partials when doing the conversions.
In the blog post comments, someone mentions that the new naming scheme doesn't work for partials, which is why the regex is the way it is. Does anyone know what he's referring to? Was this a bug that was around for a while in edge Rails but then corrected?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
下面有两条评论,另一条评论提到了修复该问题的修订版。
Two comments below that one, another mentions the revision where that issue was fixed.