diff --git a/app/controllers/management/document_verifications_controller.rb b/app/controllers/management/document_verifications_controller.rb index 32d38c748..1b8fabcc2 100644 --- a/app/controllers/management/document_verifications_controller.rb +++ b/app/controllers/management/document_verifications_controller.rb @@ -1,5 +1,6 @@ class Management::DocumentVerificationsController < Management::BaseController + before_action :clean_document_number, only: :check before_action :set_document, only: :check def index @@ -41,4 +42,8 @@ class Management::DocumentVerificationsController < Management::BaseController session[:document_number] = params[:document_verification][:document_number] end + def clean_document_number + params[:document_verification][:document_number] = params[:document_verification][:document_number].gsub(/[^a-z0-9]+/i, "").upcase unless params[:document_verification][:document_number].blank? + end + end \ No newline at end of file diff --git a/app/views/layouts/management.html.erb b/app/views/layouts/management.html.erb index 0f641ad13..354fae1a1 100644 --- a/app/views/layouts/management.html.erb +++ b/app/views/layouts/management.html.erb @@ -27,7 +27,7 @@