Skip to content

Commit

Permalink
Create index.json.jbuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Sep 20, 2024
1 parent bf98b86 commit 6c7b3db
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
json.array! @transactions do |transaction|
json.extract! transaction, :id, :amount, :transaction_type, :created_at
json.account do
json.extract! transaction.account, :id, :account_number, :routing_number
end
json.user do
json.extract! transaction.account.user, :id, :username, :email
end
json.url api_v1_transaction_url(transaction, format: :json)
json.category do
json.extract! transaction.category, :id, :name
end
end

0 comments on commit 6c7b3db

Please sign in to comment.