I’ve got this code in my matches index:
<table>
<% @matches.each do |match| %>
<tr>
<td><%= match.team_a %></td>
<td><%= match.team_b %></td>
<td><%= match.score_a %> - <%= match.score_b %></td>
<td><%= match.field %></td>
<%= render "shared/asterisk_message", :target => [match.team_b, match.team_a] %>
<% end %>
</table>
I want to move the rendered asterisk_message outside the table, but this would mean to put it after the <% end %>, which obviously gives me this error:
undefined local variable or method `match’ for #<#:0xb6da40d8>
How can I work it out?
Try: