app/views/answer_stocks/index.html.erb
<div class="page-header">
<h1>ストック一覧</h1>
</div>
<table class="table table-striped">
<thead>
<tr>
<th>学校名</th>
<th>学科名</th>
<th>実施年</th>
<th>教科</th>
</tr>
</thead>
<tbody>
<% @answers.each do |answer| %>
<tr>
<td><%= answer.school.name %></td>
<td><%= answer.department.name %></td>
<td><%= answer.year %></td>
<td>
<%= link_to answer.subject, answer_path(answer) %>
</td>
</tr>
<% end %>
</tbody>
</table>