Fixed pagination for weeks
This commit is contained in:
parent
a3741d18a2
commit
75df7a2968
|
|
@ -79,7 +79,8 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def collection
|
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
|
end
|
||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,5 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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 %>
|
<% end %>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue