你的文章 controller 不应该管理关系。那应该是你的 model 。查看活动记录 callbacks 。您可以在回调中执行与管理作者,翻译等相关的所有操作。例如,在 after_update 打回来
controller
model
callbacks
after_update
你也想要使用 nested resources 。例如,你的 authors 嵌套在你的 articles
nested resources
authors
articles
例如,也许您可以拥有一个管理作者的作者控制器< - >文章关系。 不要忘记您可以使用“连接”模型来处理所涉及的两个模型之间的关系。 你可以有像这样的路线
edit_article_authorships GET /articles/:article_id/authorships/edit(.:format) {:controller=>"authorships", :action=>"edit"}