intl_phone_picker 0.0.7.5 → 0.0.7.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a919e4da1205be521a194b0a4612adc19be57dd2
|
4
|
+
data.tar.gz: 220689e9f04bdd26d47bde6c7b978b75f38ee8ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4200b8488503a35d9d257819a6735c9122c275a2000f1ed3af98a27c9b848a3d37891f2238d5941e284d36472dcb7572bd0f8d652c6337ddf58f9c92bb6bbe75
|
7
|
+
data.tar.gz: 055cdf7c806366553c87a1a2f6a5f3f1f06671d26871051f4e2fdc54fbab82b17b1877f603333500474ef9f771b533edefde2746de91abd3a8545bcac5f28660
|
@@ -3,11 +3,12 @@ class ActionView::Helpers::FormBuilder
|
|
3
3
|
def intl_phone_input(object_name, options = {})
|
4
4
|
options = IntlPhonePicker::options_keys_to_sym options
|
5
5
|
data_phone_field_attr = "#{self.object_name}[#{object_name}]"
|
6
|
+
hidden_field_name = "#{self.object_name}[#{options[:hidden_intl_field]}]" if options[:hidden_intl_field].presence
|
6
7
|
|
7
|
-
phones_fields = telephone_field(object_name, options.merge(class: "#{options[:class]} #{IntlPhonePicker::intl_class_name}").except(:hidden_intl_field))
|
8
|
+
phones_fields = telephone_field(object_name, options.merge(class: "#{options[:class]} #{IntlPhonePicker::intl_class_name}".strip).except(:hidden_intl_field))
|
8
9
|
phones_fields << hidden_field(options[:hidden_intl_field], { 'data-phone-field' => data_phone_field_attr }) if options[:hidden_intl_field].presence
|
9
10
|
|
10
|
-
@template.render partial: 'intl_phone_picker/intl_helper', locals: { phones_fields: phones_fields, visible_input_name: data_phone_field_attr, hidden_input_name:
|
11
|
+
@template.render partial: 'intl_phone_picker/intl_helper', locals: { phones_fields: phones_fields, visible_input_name: data_phone_field_attr, hidden_input_name: hidden_field_name }
|
11
12
|
end
|
12
13
|
|
13
14
|
end
|
@@ -4,7 +4,7 @@ module IntlPhonePicker
|
|
4
4
|
def intl_phone_tag(name, value = nil, options = {})
|
5
5
|
options = IntlPhonePicker::options_keys_to_sym options
|
6
6
|
|
7
|
-
phones_fields = telephone_field_tag(name, value, options.merge(class: "#{options[:class]} #{IntlPhonePicker::intl_class_name}").except(:hidden_intl_field))
|
7
|
+
phones_fields = telephone_field_tag(name, value, options.merge(class: "#{options[:class]} #{IntlPhonePicker::intl_class_name}".strip).except(:hidden_intl_field))
|
8
8
|
phones_fields << hidden_field_tag(options[:hidden_intl_field], value, { 'data-phone-field' => name }) if options[:hidden_intl_field].presence
|
9
9
|
|
10
10
|
render partial: 'intl_phone_picker/intl_helper', locals: { phones_fields: phones_fields, visible_input_name: name, hidden_input_name: options[:hidden_intl_field] }
|