From db478e5fbd0478f3cced06d9306b100ca160f7ec Mon Sep 17 00:00:00 2001 From: Jesper Christiansen Date: Tue, 6 Feb 2024 17:45:17 -0800 Subject: [PATCH] Add Account type investment form (#343) * Add Account type investment form * Move subtypes to Account::Investment * Linting --- app/models/account/investment.rb | 12 ++++++++++++ app/views/accounts/account/_investment.html.erb | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/app/models/account/investment.rb b/app/models/account/investment.rb index 57bdfcf8..87675da6 100644 --- a/app/models/account/investment.rb +++ b/app/models/account/investment.rb @@ -1,3 +1,15 @@ class Account::Investment < ApplicationRecord include Accountable + + SUBTYPES = [ + [ "Brokerage", "brokerage" ], + [ "Pension", "pension" ], + [ "Retirement", "retirement" ], + [ "401(k)", "401k" ], + [ "529 plan", "529_plan" ], + [ "Health Savings Account", "hsa" ], + [ "Mutual Fund", "mutual_fund" ], + [ "Roth IRA", "roth_ira" ], + [ "Roth 401k", "roth_401k" ] + ].freeze end diff --git a/app/views/accounts/account/_investment.html.erb b/app/views/accounts/account/_investment.html.erb index e69de29b..6310d930 100644 --- a/app/views/accounts/account/_investment.html.erb +++ b/app/views/accounts/account/_investment.html.erb @@ -0,0 +1,4 @@ +
+ + <%= f.select :subtype, options_for_select(Account::Investment::SUBTYPES, selected: ""), {}, class: "block w-full p-0 mt-1 bg-transparent border-none focus:outline-none focus:ring-0" %> +