1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-25 16:19:40 +02:00

Allow institutions on edit account form

This commit is contained in:
Zach Gollwitzer 2024-10-10 11:43:28 -04:00
parent dce9adb534
commit aa16807c6c
2 changed files with 9 additions and 1 deletions

View file

@ -4,7 +4,13 @@
<div class="grow space-y-2"> <div class="grow space-y-2">
<%= f.hidden_field :accountable_type %> <%= f.hidden_field :accountable_type %>
<%= f.text_field :name, placeholder: t(".name_placeholder"), required: "required", label: t(".name_label"), autofocus: true %> <%= f.text_field :name, placeholder: t(".name_placeholder"), required: "required", label: t(".name_label"), autofocus: true %>
<%= f.hidden_field :institution_id %>
<% if account.new_record? %>
<%= f.hidden_field :institution_id %>
<% else %>
<%= f.collection_select :institution_id, Current.family.institutions.alphabetically, :id, :name, { include_blank: t(".ungrouped"), label: t(".institution") } %>
<% end %>
<%= f.money_field :balance, label: t(".balance"), required: true, default_currency: Current.family.currency %> <%= f.money_field :balance, label: t(".balance"), required: true, default_currency: Current.family.currency %>
<% if account.new_record? %> <% if account.new_record? %>

View file

@ -86,6 +86,8 @@ en:
new_account: New account new_account: New account
no_accounts: No accounts yet no_accounts: No accounts yet
form: form:
institution: Financial institution
ungrouped: "(none)"
balance: Current balance balance: Current balance
name_label: Account name name_label: Account name
name_placeholder: Example account name name_placeholder: Example account name