ActiveAdmin 抛出未定义的方法“stringify_keys”
我正在使用 ActiveAdmin 0.4.1 和 Rails 3.2.1。 在普通的 Rails 应用程序中,我通过脚手架创建了一个新模型,并将其设置为 ActiveAdmin 的资源。当我尝试使用 ActiveAdmin 后端创建我的模式的新实体时,我
undefined method `stringify_keys' for "new":String
没有任何应用程序痕迹。仅框架跟踪:
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:69:in `assign_attributes'
activerecord (3.2.1) lib/active_record/base.rb:495:in `initialize'
inherited_resources (1.3.0) lib/inherited_resources/base_helpers.rb:52:in `new'
inherited_resources (1.3.0) lib/inherited_resources/base_helpers.rb:52:in `build_resource'
activeadmin (0.4.1) lib/active_admin/resource_controller/callbacks.rb:15:in `build_resource'
- snip -
对此可能的解决方案是什么?
I am Using ActiveAdmin 0.4.1 with Rails 3.2.1.
In a plain rails app I create a new model via scaffolding and set it up as a resource for ActiveAdmin. When I try to create a new entity of my mode using the ActiveAdmin backend I get
undefined method `stringify_keys' for "new":String
without any application traces. Only the framework trace:
activerecord (3.2.1) lib/active_record/attribute_assignment.rb:69:in `assign_attributes'
activerecord (3.2.1) lib/active_record/base.rb:495:in `initialize'
inherited_resources (1.3.0) lib/inherited_resources/base_helpers.rb:52:in `new'
inherited_resources (1.3.0) lib/inherited_resources/base_helpers.rb:52:in `build_resource'
activeadmin (0.4.1) lib/active_admin/resource_controller/callbacks.rb:15:in `build_resource'
- snip -
What could be a possible solution to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查型号的名称并确保您没有使用特殊的单词。
当我将模型命名为“Action”时,这种情况就发生在我身上。
Check the name of the model and make sure you are not using a special word for it.
This happened to me when I named my model 'Action'.