使用连接模型(has_many 至)和额外字段创建和更新两个模型
我一直在尝试简化我上一篇文章的上下文(大约 6 小时前:https://stackoverflow.com/questions/5150031/linking-third-models-through-two-join-models),只需通过连接链接我的两个主要列(属性和用户)模型(演员),其中我有两个 id(property_id 和 user_id)和一个字符串列(角色),我将为其添加纯文本。但是,我什至不知道如何在视图中为这个简单的模型进行简单的创建;我已经阅读了大约几十个关于 has_many :through 和额外字段的线程,但仍然不知道如何做到这一点...有人对如何实现这个有一个简单的答案吗?看来如果我使用.net,我大约两周前就完成了......
I've been trying to simplify the context of a previous post of mine (from about 6 hours ago: https://stackoverflow.com/questions/5150031/linking-three-models-through-two-join-models) by simply having my two main columns (properties and users) linked through a join model (actorships) in which I have the two ids (property_id and user_id) and a string column (role) for which I'd add plain text. However, I don't even know how to do a simle create in the view for this simple model; I've read like a couple dozen threads about the has_many :through and the extra fields and still have no clue how to do it... Anyone has a simple answer to how to implement this? It seems that if I was using .net, I would have finished about 2 weeks ago...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)