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 0e1803e commit 14ba305
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions global_business/business/views/api/v1/accounts/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
json.array! @accounts do |account|
json.extract! account, :id, :account_number, :routing_number, :account_type
json.user do
json.extract! account.user, :id, :username, :email
end
json.url api_v1_account_url(account, format: :json)
json.transactions account.transactions do |transaction|
json.extract! transaction, :id, :amount, :transaction_type
json.url api_v1_transaction_url(transaction, format: :json)
end
end

0 comments on commit 14ba305

Please sign in to comment.