From 8c0d6544752a2a2471f84da4644b3c57658ec653 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Thu, 30 May 2019 16:00:36 +0300 Subject: [PATCH] Improve UI --- app/controllers/registrar/account_controller.rb | 5 +++++ app/views/registrar/account/_form.html.erb | 3 ++- config/locales/registrar/account.en.yml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/registrar/account_controller.rb b/app/controllers/registrar/account_controller.rb index 9252098b8..0bb40ae3c 100644 --- a/app/controllers/registrar/account_controller.rb +++ b/app/controllers/registrar/account_controller.rb @@ -1,6 +1,7 @@ class Registrar class AccountController < BaseController skip_authorization_check + helper_method :iban_max_length def show; end @@ -20,5 +21,9 @@ class Registrar def registrar_params params.require(:registrar).permit(:billing_email, :iban) end + + def iban_max_length + Iban.max_length + end end end \ No newline at end of file diff --git a/app/views/registrar/account/_form.html.erb b/app/views/registrar/account/_form.html.erb index 7a7e4491b..ab1fb0294 100644 --- a/app/views/registrar/account/_form.html.erb +++ b/app/views/registrar/account/_form.html.erb @@ -17,7 +17,8 @@
- <%= f.text_field :iban, class: 'form-control' %> + <%= f.text_field :iban, maxlength: iban_max_length, class: 'form-control' %> + <%= t '.iban_hint' %>
diff --git a/config/locales/registrar/account.en.yml b/config/locales/registrar/account.en.yml index 94d4783d5..a4f3f8f2a 100644 --- a/config/locales/registrar/account.en.yml +++ b/config/locales/registrar/account.en.yml @@ -8,6 +8,7 @@ en: header: Edit your account form: + iban_hint: Required for sending e-invoices to the bank submit_btn: Save changes update: