mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
add pagination to account transactions list (#1095)
* add pagination to account transactions list * use global pagination partial
This commit is contained in:
parent
9dda2606d5
commit
c70a08aca2
5 changed files with 13 additions and 4 deletions
|
@ -5,7 +5,10 @@ class Account::TransactionsController < ApplicationController
|
|||
before_action :set_entry, only: :update
|
||||
|
||||
def index
|
||||
@entries = @account.entries.account_transactions.reverse_chronological
|
||||
@pagy, @entries = pagy(
|
||||
@account.entries.account_transactions.reverse_chronological,
|
||||
limit: params[:per_page] || "10"
|
||||
)
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
<%= render entries %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pt-4">
|
||||
<%= render "pagination", pagy: @pagy %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<%= form_with url: transactions_path,
|
||||
<%= form_with url: url_for,
|
||||
method: :get,
|
||||
class: "flex items-center gap-4",
|
||||
data: { controller: "auto-submit-form" } do |f| %>
|
5
config/locales/views/application/en.yml
Normal file
5
config/locales/views/application/en.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
en:
|
||||
application:
|
||||
pagination:
|
||||
rows_per_page: Rows per page
|
|
@ -42,7 +42,5 @@ en:
|
|||
success: Marked as transfer
|
||||
new:
|
||||
new_transaction: New transaction
|
||||
pagination:
|
||||
rows_per_page: Rows per page
|
||||
unmark_transfers:
|
||||
success: Transfer removed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue