We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2a19ce commit 9c3061cCopy full SHA for 9c3061c
lib/decidim/extra_user_fields/form_builder_methods.rb
@@ -5,10 +5,11 @@ module ExtraUserFields
5
# This module adds the FormBuilder methods for extra user fields
6
module FormBuilderMethods
7
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
+ label_text = options[:label].presence || label_for(name)
+ html = +""
+ html << (label_text + required_for_attribute(name)) if options.fetch(:label, true)
+ html << sanitize_country_select(country_select(name))
12
+ html.html_safe
13
end
14
15
private
0 commit comments