ActiveSupport::Ramaze 项目中的 Inflector?
我刚刚升级到 ActiveSupport 3,丢失了所有字符串方法,例如“camelize”、“titleize”等。它破坏了我整个项目的一切,到目前为止,我已经通过自己重写这些方法来修复它们,但必须有更好的方法。我确实意识到 ActiveSupport 不再在全局范围内修补 String 可能是一件好事,但是,它对我来说非常有用。无论如何,我可以将这些东西修补回字符串上,或者找到一种新的方式来调用它们吗?
I just upgraded to ActiveSupport 3 and lost all my string methods like "camelize", "titleize", and the like. It broke things all over my project, and so far I've fixed them by re-writing those methods myself, but there has to be a better way. I do realize that it's probably a good thing that ActiveSupport no longer monkey patches String globally, but, it was working great for me. Is there anyway I can patch these things back onto string, of find a new way to call them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能正在这样做:
这需要非常非常基础的主动支持。
你想要的是这样的:
You're probably doing this:
Which requires the very, very basics of Active Support.
What you want is this: