1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 05:25:24 +02:00

Add error handling for vehicle and property account creation (#1179)

* add error handling for vehicle and property account creation

* Add required true for money_field

* Remove rescue in controllers
This commit is contained in:
Tony Vincent 2024-09-17 16:37:09 +02:00 committed by GitHub
parent aa6d755402
commit e06f0c76f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 6 deletions

View file

@ -1,4 +1,4 @@
<%# locals: (form:, money_method:, default_currency:, disable_currency: false, hide_currency: false, label: nil) %>
<%# locals: (form:, money_method:, default_currency:, disable_currency: false, hide_currency: false, label: nil, required: false) %>
<% fallback_label = t(".money-label") %>
<% currency = form.object ? (form.object.send(money_method)&.currency || Money::Currency.new(default_currency)) : Money::Currency.new(default_currency) %>
@ -9,7 +9,7 @@
<div class="flex items-center gap-1">
<div class="flex items-center grow gap-1">
<span class="text-gray-500 text-sm" data-money-field-target="symbol"><%= currency.symbol %></span>
<%= money_field form, money_method, { inline: true, "data-money-field-target" => "amount", default_currency: currency } %>
<%= money_field form, money_method, { inline: true, "data-money-field-target" => "amount", default_currency: currency, required: required } %>
</div>
<% unless hide_currency %>
<div>