我决定好了,我不知道这是否是最好的方法(在 app/controllers/question_controller.rb 中):
<% @questions.each do |question| %>
<% if (question.dimension.survey.user_id == @current_user.id) %>
<tr>
<td><%= question.dimension.survey.user.name %></td>
<td><%= question.dimension.survey.title %></td>
<td><%= question.dimension.name %></td>
<td><%= question.question %></td>
<td><%= question.order %></td>
<td><%= question.status %></td>
<td><%= link_to 'Show', question %></td>
<td><%= link_to 'Edit', edit_question_path(question) %></td>
<td><%= link_to 'Destroy', question, method: :delete, data: { confirm: 'Are you sure?' } %>
</td>
</tr>
<% end %>
<% end %>