Module: Decidim::ExtraUserFields::FormBuilderMethods

Defined in:
lib/decidim/extra_user_fields/form_builder_methods.rb

Overview

This module adds the FormBuilder methods for extra user fields

Instance Method Summary collapse

Instance Method Details

#custom_country_select(name, options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/decidim/extra_user_fields/form_builder_methods.rb', line 7

def custom_country_select(name, options = {})
  label_text = options[:label].to_s
  label_text = label_for(name) if label_text.blank?

  template = ""
  template += label(name, label_text + required_for_attribute(name)) if options.fetch(:label, true)
  template += country_select(name)
  template.html_safe
end