Disable sorttable on tables without rows

Otherwise, the first element of the table body is being fetched which might result in an error for empty tables.

Fixes CODEOCEAN-JZ
This commit is contained in:
Sebastian Serth
2023-03-14 18:27:38 +01:00
parent 1c5eb09138
commit a99da79550
11 changed files with 12 additions and 12 deletions

View File

@@ -28,7 +28,7 @@ h1 = @exercise_collection
h4.mt-4 = t('activerecord.attributes.exercise_collections.exercises')
.table-responsive#exercise-list
table.table.sortable
table.table class="#{@exercise_collection.items.present? ? 'sortable' : ''}"
thead
tr
th = '#'