Rails 找不到首选项关联的有效模型
这是我添加新记录的表单:
参数发送正确,但是当我单击“上传”按钮时,没有任何反应,如果我尝试从 Rails 控制台添加记录,但出现第一张图像的错误。我是 RoR 的新开发者,有人可以帮助我吗?谢谢!
I'm trying to add new record to my DB, but I got this error:
And this is my form to add a new record:
The param is sending correctly, but when I click on Upload button, nothing is happen, and if I try to add the record from the rails console, I got the error of the first image. I'm a new dev of RoR, someone can help me please?, Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不查看相关模型及其关联,什么都不清楚,因为,似乎您的模型关联导致了此错误。
模型关联描述了模型之间的关系(如果是一对一、一对多等),称为继承,这是任何面向对象编程中非常重要的概念。这就是我们在 Rails 中实现它的方式
请仔细阅读此文档。
它可能会帮助您更好地了解 Rails 关联。
Without looking at the related models and their associations nothing is clear, because, it seems like your model associations are causing this error.
Model associations depict the relations between models (if its one-one, one-many and such) known as inheritance, very important concept in any object oriented programming. this is the way we implement it in rails
Go through this documentation.
It might help you get better understanding of rails associations.