1
讓我們回到黃銅大頭釘。inherited_resources和多個belongs_to沒有嵌套
滑軌:2.3.11
我使用inherited_resources引用兩個單獨的和非嵌套資源具有控制器。
我的控制器是如下所示:
class Tools::DeploymentLinesController < ToolsController
inherit_resources
belongs_to :deployment
belongs_to :ticket
end#Tools::DeploymentLinesController
然而,inherit_resources
被假定belongs_to :ticket
是deployment
嵌套資源。
是否有任何方法在我的控制器中使用兩個belongs_to
而沒有嵌套?或者我需要寫出自己的業務邏輯來解釋遺漏的inherited_resources關聯?