4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/simple_form_password_with_hints/password_with_sync_input.rb', line 4
def input(wrapper_options = nil)
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
merged_input_options[:class] << " js-sfpwh-input js-sfpwh-sync-input "
if options[:compare_with_field]
if merged_input_options[:data].nil?
merged_input_options[:data] = { link_to: linked_field_name }
else
merged_input_options[:data][:link_to] = linked_field_name
end
@builder.password_field(attribute_name, merged_input_options) +
password_uncloaking_div +
template.content_tag(:div, '', class: 'sfpwh-controls js-sfpwh-controls') do
template.content_tag(
:span,
t('simple_form_password_with_hints.test_fields_matching'),
class: 'sfpwh-hint sfpwh-hint--invalid sfpwh-hint--match js-sfpwh-hint-match'
)
end
else
@builder.password_field(attribute_name, merged_input_options)
end
end
|