Skip to content

Commit

Permalink
paginate orders
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Oct 28, 2024
1 parent ee879b8 commit f54e8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/product_purchases_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ class ProductPurchasesController < ApplicationController
before_action :authenticate_user!

def index
@purchases = current_user.product_purchases.order(created_at: :desc)
@purchases = current_user.product_purchases
.order(created_at: :desc)
.page(params[:page]).per(30)
end

def show
Expand Down
2 changes: 2 additions & 0 deletions app/views/product_purchases/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@
</div>

<% end %>
<%= paginate @purchases %>

0 comments on commit f54e8a6

Please sign in to comment.