diff --git a/app/models/account.rb b/app/models/account.rb index 9f130896..f561d1b8 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,3 +1,5 @@ class Account < ApplicationRecord belongs_to :family + + scope :depository, -> { where(type: 'Depository') } end diff --git a/app/views/accounts/index.html.erb b/app/views/accounts/index.html.erb index 24ad03e5..8eda0d01 100644 --- a/app/views/accounts/index.html.erb +++ b/app/views/accounts/index.html.erb @@ -1,8 +1,14 @@ -
-

Accounts#index

-

Find me in app/views/accounts/index.html.erb

-
-<% @accounts.each do |account| %> - <%= account.name %> -<% end %> +

Cash

+

<%#= number_to_currency current_family.cash_balance %>

+ +<% current_family.accounts.depository.each do |account| %> +
+
+ <%= account.name %> +
+

+ <%= number_to_currency account.balance %> +

+
+ <% end %> \ No newline at end of file