Skip to content

Commit 9c3061c

Browse files
committed
fix custom_country_select
1 parent e2a19ce commit 9c3061c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/decidim/extra_user_fields/form_builder_methods.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ module ExtraUserFields
55
# This module adds the FormBuilder methods for extra user fields
66
module FormBuilderMethods
77
def custom_country_select(name, options = {})
8-
label_text = options[:label].to_s
9-
label_text = label_for(name) if label_text.blank?
10-
select_html = sanitize_country_select(country_select(name))
11-
(label_text + select_html).html_safe
8+
label_text = options[:label].presence || label_for(name)
9+
html = +""
10+
html << (label_text + required_for_attribute(name)) if options.fetch(:label, true)
11+
html << sanitize_country_select(country_select(name))
12+
html.html_safe
1213
end
1314

1415
private

0 commit comments

Comments
 (0)