From 6d0e5febe9ba85c3d1632c7af58b1832492a7413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20K=C4=B1l=C4=B1=C3=A7?= Date: Wed, 7 Feb 2024 04:48:05 +0300 Subject: [PATCH] Fix accountable text and alignment (#330) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #319 Accountable text format * Fix account index table alignment * Update to_accountable_title helper --------- Signed-off-by: Muhammed Kılıç --- app/helpers/accounts_helper.rb | 3 +++ app/views/accounts/index.html.erb | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb index 17850b4b..0673bf2a 100644 --- a/app/helpers/accounts_helper.rb +++ b/app/helpers/accounts_helper.rb @@ -1,2 +1,5 @@ module AccountsHelper + def to_accountable_title(accountable) + accountable.model_name.human + end end diff --git a/app/views/accounts/index.html.erb b/app/views/accounts/index.html.erb index ef727457..34bc5672 100644 --- a/app/views/accounts/index.html.erb +++ b/app/views/accounts/index.html.erb @@ -3,14 +3,14 @@

<%#= number_to_currency Current.family.cash_balance %>

<% Current.family.accounts.each do |account| %> -
-
+
+
<%= account.name %>
-
- <%= account.accountable.model_name.human %> +
+ <%= to_accountable_title(account.accountable) %>
-

+

<%= humanized_money_with_symbol account.balance %>