From f5311301c9c7cf72c7ed8bb744d5914079ef1393 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Mon, 10 Aug 2015 22:23:58 +0300 Subject: [PATCH] Registrant: remember invalid contact values --- app/views/registrar/contacts/form_partials/_general.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/registrar/contacts/form_partials/_general.haml b/app/views/registrar/contacts/form_partials/_general.haml index 6d7f2845f..9ef12d8f1 100644 --- a/app/views/registrar/contacts/form_partials/_general.haml +++ b/app/views/registrar/contacts/form_partials/_general.haml @@ -11,7 +11,7 @@ = Country.new(f.object.ident_country_code).try(:to_s) = " [#{f.object.ident_country_code}]" - else - - country_selected = @contact.persisted? ? '' : 'EE' + - country_selected = @contact.persisted? ? '' : (params[:depp_contact].try(:[], :ident_country_code) || 'EE') = f.select(:ident_country_code, SortedCountry.all_options(country_selected), {}, class: 'js-ident-country-code', required: true) @@ -24,7 +24,7 @@ = Depp::Contact.type_string(f.object.ident_type) = " [#{f.object.ident_type}]" - else - - type_selected = @contact.persisted? ? '' : 'bic' + - type_selected = @contact.persisted? ? '' : (params[:depp_contact].try(:[], :ident_type) || 'bic') = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: type_selected }, class: 'js-ident-type', required: true)