自定义变形在rails3上不起作用?
我正在使用 Rails (3.0.1) 并在initializers/inflections.rb 中有以下代码
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular('nursery', 'nurseries')
end
从我得到的控制台:
"nursery".pluralize => "nurseries"
"nurseries".singularize => "nurseries"
我应该得到:
"nurseries".singularize => "nursery"
有什么想法吗?
I'm using Rails (3.0.1) and have the following code in initializers/inflections.rb
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular('nursery', 'nurseries')
end
From the console I'm getting:
"nursery".pluralize => "nurseries"
"nurseries".singularize => "nurseries"
I should be getting:
"nurseries".singularize => "nursery"
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论