Registrant: remember invalid contact values

This commit is contained in:
Priit Tark 2015-08-10 22:23:58 +03:00
parent d8125ebea4
commit f5311301c9

View file

@ -11,7 +11,7 @@
= Country.new(f.object.ident_country_code).try(:to_s) = Country.new(f.object.ident_country_code).try(:to_s)
= " [#{f.object.ident_country_code}]" = " [#{f.object.ident_country_code}]"
- else - 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), {}, = f.select(:ident_country_code, SortedCountry.all_options(country_selected), {},
class: 'js-ident-country-code', required: true) class: 'js-ident-country-code', required: true)
@ -24,7 +24,7 @@
= Depp::Contact.type_string(f.object.ident_type) = Depp::Contact.type_string(f.object.ident_type)
= " [#{f.object.ident_type}]" = " [#{f.object.ident_type}]"
- else - 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, = f.select(:ident_type, Depp::Contact::SELECTION_TYPES,
{ selected: type_selected }, { selected: type_selected },
class: 'js-ident-type', required: true) class: 'js-ident-type', required: true)