Rails - 活动管理 - 错误的复数路径 - 如何修复它?
活动管理员为我的资源写了错误的路径。我不知道如何改变它。我用谷歌搜索,阅读文档,但没有找到任何解决方案。
我生成了 Imagem 资源
rails generate active_admin:resource Imagem
浏览管理页面并收到以下错误:
localhost:3000/admin
gems/activeadmin-0.3.4/app/views/active_admin/dashboard/index.html.arb where line #1 raised:
undefined method `admin_imagems_path' for #<ActiveAdmin::MenuItem:0x00000006881f98>
应该是 admin_imagens_path,但我不知道如何更改它。
我的 inflactors.rb 有以下
inflect.plural 'imagem', 'imagens'
inflect.singular 'imagens', 'imagem'
TIA
Active admin wrote the wrong path for my resource. I don't know how to change it. I googled that, read the documentation but I didn't find any solution.
I generated the Imagem resource
rails generate active_admin:resource Imagem
Browsed the admin page and got the following error:
localhost:3000/admin
gems/activeadmin-0.3.4/app/views/active_admin/dashboard/index.html.arb where line #1 raised:
undefined method `admin_imagems_path' for #<ActiveAdmin::MenuItem:0x00000006881f98>
That should be admin_imagens_path, but I don't know how to change it.
My inflactors.rb has the following
inflect.plural 'imagem', 'imagens'
inflect.singular 'imagens', 'imagem'
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我记得,
应该在两个方向上工作(单数到复数,复数到单数)。
As far as I can remember,
should work in both directions (singular to plural and plural to singular).