Skip to content

Commit 5e1a53f

Browse files
author
Theresa
committed
Fix case that exercise is undefined
1 parent fe49618 commit 5e1a53f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/views/comments/comments_all.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<tbody>
1515
<% @comments.each do |comment| %>
1616
<tr>
17-
<td><%= link_to comment.exercise.title, exercise_path(comment.exercise) %></td>
17+
<% if !comment.exercise %>
18+
<td> <%= 'Exercise undefined' %> </td>
19+
<% else %>
20+
<td><%= link_to comment.exercise.title, exercise_path(comment.exercise) %></td>
21+
<% end %>
1822
<td><%= comment.text %></td>
1923
<% if !comment.user %>
2024
<td> <%= 'User undefined' %> </td>

0 commit comments

Comments
 (0)