app/views/shared/_promises_table.html.erb
<table class="table table-striped">
<thead>
<tr>
<th><%= ParliamentPeriod.model_name.human.capitalize %></th>
<th><%= Promise.human_attribute_name :party %></th>
<th><%= Promise.human_attribute_name :body %></th>
<th><%= Promise.human_attribute_name :source %></th>
<th><%= Category.model_name.human(count: 2).capitalize %></th>
</tr>
</thead>
<tbody>
<% promises.each do |promise| %>
<tr>
<td><%= promise.parliament_period_name %></td>
<td>
<% promise.parties.each do |party| %>
<%= link_to party.name, party %>
<% end %>
<% if promise.promisor.kind_of? Government %>
(<%= promise.promisor.name %>)
<% end %>
</td>
<td><%= promise.body %></td>
<td><%= promise.source %></td>
<td>
<% promise.categories.each do |c| %>
<%= link_to c.name, c %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>