Updated all current Models to include Pagination for index views.
This commit is contained in:
parent
d5e19f561e
commit
66aaeb4ed6
|
@ -3,7 +3,7 @@ class EmployersController < ApplicationController
|
||||||
|
|
||||||
# GET /employers
|
# GET /employers
|
||||||
def index
|
def index
|
||||||
@employers = Employer.order(:last_name)
|
@employers = Employer.order(:last_name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /employers/:id
|
# GET /employers/:id
|
||||||
|
|
|
@ -3,7 +3,6 @@ class ParticipantsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@participants = Participant.order(:last_name).page(params[:page]).per(5) # Adjust the number per page as needed
|
@participants = Participant.order(:last_name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class VendorsController < ApplicationController
|
class VendorsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@vendors = Vendor.all
|
@vendors = Vendor.order(:name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class WorkersController < ApplicationController
|
class WorkersController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@workers = Worker.all
|
@workers = Worker.order(:last_name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<%= link_to 'New Employer', new_employer_path, class: 'btn btn-dark mb-3' %>
|
<%= link_to 'New Employer', new_employer_path, class: 'btn btn-dark mb-3' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= paginate @employers %>
|
||||||
|
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<%= link_to 'New Vendor', new_vendor_path, class: 'btn btn-dark mb-3' %>
|
<%= link_to 'New Vendor', new_vendor_path, class: 'btn btn-dark mb-3' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= paginate @vendors %>
|
||||||
|
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<%= link_to 'New Worker', new_worker_path, class: 'btn btn-dark mb-3' %>
|
<%= link_to 'New Worker', new_worker_path, class: 'btn btn-dark mb-3' %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= paginate @workers %>
|
||||||
|
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue