我有一个QuestionController 现在我有AnotherQuestionController,其中的操作应该使用位于app/views/question/中的模板和部分呈现。 这是可能的吗?看起来应该是可以的。
我已经尝试过
render :template => "question/answer"
但是 answer.html.erb 包括一些 partials,我得到了如下错误:
"在视图路径中找不到 another_question/_my_partial.erb "
那么,有没有办法告诉 Rails "将 AnotherQuestionController 视为 QuestionController,然后在 app/views/question 中查找视图和 partials"?还是我必须创建一个 app/views/another_question 目录 —— 这会导致重复(这不可能是 Rails 的做法)。
谢谢