Class: ActionView::Helpers::InstanceTag

Inherits:
Object
  • Object
show all
Defined in:
lib/country-select-iso.rb

Instance Method Summary collapse

Instance Method Details

#to_country_select_tag(options, html_options) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
# File 'lib/country-select-iso.rb', line 54

def to_country_select_tag(options, html_options)
  html_options = html_options.stringify_keys
  add_default_name_and_id(html_options)
  value = value(object)
  ("select",
    add_options(
      country_options_for_select(value, options).html_safe,
      options, value
    ), html_options
  )
end

#to_state_select_tag(options, html_options) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/country-select-iso.rb', line 66

def to_state_select_tag(options, html_options)
  html_options = html_options.stringify_keys
  add_default_name_and_id(html_options)
  value = value(object)
  ("select",
    add_options(
      state_options_for_select(value, options).html_safe,
      options, value
    ), html_options
  )
end