Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上,如果我在控制器 A 中有一个表,我想在属于控制器 B 的视图中显示它,我将如何处理它。
如果您有一个app/views/controllera/_partial.html.erb包含您的表格的部分,则可以从app/views/controllerb/some_action.html.erb如下视图中呈现部分
app/views/controllera/_partial.html.erb
app/views/controllerb/some_action.html.erb
<%= render partial: "controllera/partial", locals: { ... } %>