mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Fix mode bug
This commit is contained in:
parent
263d65ea7e
commit
3c0fdd84ee
9 changed files with 26 additions and 4 deletions
|
@ -3,7 +3,9 @@
|
|||
<%= styled_form_with model: account, url: url, scope: :account, class: "flex flex-col gap-4 justify-between grow", data: { turbo: false } do |f| %>
|
||||
<div class="grow space-y-2">
|
||||
<% unless account.new_record? %>
|
||||
<%= f.select :mode, Account::VALUE_MODES.map { |mode| [mode.titleize, mode] }, { label: t(".mode"), prompt: t(".mode_prompt") } %>
|
||||
<% if account.accountable.mode_required? %>
|
||||
<%= f.select :mode, Account::VALUE_MODES.map { |mode| [mode.titleize, mode] }, { label: t(".mode"), prompt: t(".mode_prompt") }, required: true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= f.select :accountable_type, Accountable::TYPES.map { |type| [type.titleize, type] }, { label: t(".accountable_type"), prompt: t(".type_prompt") }, required: true, autofocus: true %>
|
||||
|
|
|
@ -13,4 +13,4 @@
|
|||
<span>Transactions</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -28,4 +28,4 @@
|
|||
|
||||
<div class="flex justify-center py-8">
|
||||
<%= link_to "Edit account details", edit_account_path(account), class: "btn btn--ghost", data: { turbo_frame: :modal } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -46,4 +46,4 @@
|
|||
|
||||
<div class="flex justify-center py-8">
|
||||
<%= link_to "Edit account details", edit_account_path(account), class: "btn btn--ghost", data: { turbo_frame: :modal } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue