Class: ActionView::Helpers::FormBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/core_extensions/action_view/helpers/form_options_helper.rb

Instance Method Summary collapse

Instance Method Details

#country_select(method, priority_or_options = {}, options = {}, html_options = {}) ⇒ Object

Generate select and country option tags with the provided name. A common use of this would be to allow users to select a country name inside a web form.

See ‘FormOptionsHelper::country_select` for more information.



93
94
95
96
97
98
99
100
101
102
# File 'lib/core_extensions/action_view/helpers/form_options_helper.rb', line 93

def country_select(method, priority_or_options = {}, options = {}, html_options = {})
  if Hash === priority_or_options
    html_options = options
    options = priority_or_options
  else
    options[:priority] = priority_or_options
  end

  @template.country_select(@object_name, method, objectify_options(options), @default_options.merge(html_options))
end