Skip to content

Commit 647c2d0

Browse files
committed
Merge branch 'master' of https://github.com/openHPI/codeharbor
2 parents a983af8 + 99c200b commit 647c2d0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/views/carts/index.html.erb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p id="notice"><%= notice %></p>
22

3-
<h2>Your Cart <%= link_to 'New Cart', new_cart_path, class:'btn btn-success' %></h2>
3+
<h2>Your Cart </h2>
44

55

66
<dl class="dl-horizontal">
@@ -9,7 +9,9 @@
99
<% if cart.user === current_user %>
1010
<% if cart.exercises %>
1111
<% cart.exercises.each do |exercise| %>
12-
<dd><%= link_to exercise.title, exercise_path(exercise) %></dd>
12+
<% if exercise %>
13+
<dd><%= link_to exercise.title, exercise_path(exercise) %></dd>
14+
<% end %>
1315
<% end %>
1416
<% else%>
1517
<dd> <%= 'No exercises added' %></dd>

app/views/collections/index.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
<td><%= collection.title %></td>
1919
<% if collection.exercises %>
2020
<% collection.exercises.each do |exercise| %>
21-
<td><%= link_to exercise.title, exercise_path(exercise) %></td>
21+
<%if exercise%>
22+
<td><%= link_to exercise.title, exercise_path(exercise) %></td>
23+
<% end %>
2224
<% end %>
2325
<% else%>
2426
<td> <%= 'No exercises added' %></td>

0 commit comments

Comments
 (0)