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
|
||||
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
|
||||
|
||||
# GET /employers/:id
|
||||
|
|
|
@ -3,7 +3,6 @@ class ParticipantsController < ApplicationController
|
|||
|
||||
def index
|
||||
@participants = Participant.order(:last_name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class VendorsController < ApplicationController
|
||||
def index
|
||||
@vendors = Vendor.all
|
||||
@vendors = Vendor.order(:name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class WorkersController < ApplicationController
|
||||
def index
|
||||
@workers = Worker.all
|
||||
@workers = Worker.order(:last_name).page(params[:page]).per(5) # Adjust the number per page as needed
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<%= link_to 'New Employer', new_employer_path, class: 'btn btn-dark mb-3' %>
|
||||
</div>
|
||||
|
||||
|
||||
<%= paginate @employers %>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-light">
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
<%= link_to 'New Vendor', new_vendor_path, class: 'btn btn-dark mb-3' %>
|
||||
</div>
|
||||
|
||||
<%= paginate @vendors %>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
<%= link_to 'New Worker', new_worker_path, class: 'btn btn-dark mb-3' %>
|
||||
</div>
|
||||
|
||||
<%= paginate @workers %>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue