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: