diff --git a/app/controllers/admin/weeks_controller.rb b/app/controllers/admin/weeks_controller.rb index 09a54c3..5962118 100644 --- a/app/controllers/admin/weeks_controller.rb +++ b/app/controllers/admin/weeks_controller.rb @@ -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. diff --git a/app/views/admin/weeks/partials/_weeks.html.erb b/app/views/admin/weeks/partials/_weeks.html.erb index d415d04..4296d68 100644 --- a/app/views/admin/weeks/partials/_weeks.html.erb +++ b/app/views/admin/weeks/partials/_weeks.html.erb @@ -22,5 +22,5 @@ <% end %> - <%= 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 %>