Class: ActionView::Helpers::InstanceTag

Inherits:
Object
  • Object
show all
Defined in:
lib/carmen/action_view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#to_country_select_tag(priority_countries, options, html_options) ⇒ Object



42
43
44
45
46
47
48
# File 'lib/carmen/action_view_helpers.rb', line 42

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

#to_state_select_tag(country, options, html_options) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/carmen/action_view_helpers.rb', line 50

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