Method: ChinaRegionFu::Utils#append_html_data_option

Defined in:
lib/china_region_fu/helpers/utils.rb

#append_html_data_option(current_region, sub_region, html_options) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
# File 'lib/china_region_fu/helpers/utils.rb', line 56

def append_html_data_option(current_region, sub_region, html_options)
  _html_options = html_options.deep_dup
  _html_options[:data] ||= {}
  _html_options[:data][:region_name] = current_region
  if sub_region
    _html_options[:data][:sub_region] = sub_region
  else
    _html_options[:data].delete(:sub_region)
  end
  _html_options
end