Fixed pagination for weeks
This commit is contained in:
parent
a3741d18a2
commit
75df7a2968
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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 %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue