Fixed pagination for weeks

This commit is contained in:
Adrian Hinz 2019-05-16 08:59:40 +02:00
parent a3741d18a2
commit 75df7a2968
2 changed files with 3 additions and 2 deletions

View File

@ -79,7 +79,8 @@ module Admin
end
def collection
@weeks = Week.by_course(params[:course_id]).page(paramas[:page])
@weeks = Week.by_course(params[:course_id]).page(params[:page])
@course = Course.find(params[:course_id])
end
# Never trust parameters from the scary internet, only allow the white list through.

View File

@ -22,5 +22,5 @@
<% end %>
</tbody>
</table>
<%= paginator @weeks, params: { controller: 'admin/weeks', action: :index } %>
<%= paginate @weeks, params: { controller: 'admin/weeks', action: :index , course_id: @course.id}, remote: true, theme: 'twitter-bootstrap-4', pagination_class: 'justify-content-center' %>
<% end %>